Conditional display of fields in category view

  • Petter
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 2 weeks ago - 7 years 2 weeks ago #114882 by Petter
Hi all,

I have a mod so I can indicate the probability if an event will be canceled/completed/fully booked.

The past 3 years I have been using this code on my Joomla! site; code is loaded via my template (custom java code). This works great; I only have to change 3 td's in /components/com_eventbooking/view/common/tmpl/event_properties.php after every update.

The latest revision of the code is not flawless (and I'm not a coder), but I think a conditional display of the registered fields in my category view will sort the issue. For events with unlimited capacity I'd like to "turn off" the registered row entirely. Is that possible?

Rgds,

Petter
Last edit: 7 years 2 weeks ago by Petter. Reason: typo

Please Log in or Create an account to join the conversation.

More
7 years 2 weeks ago #114891 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Conditional display of fields in category view
Hi Petter

I don't know about the code you are using. However, if you want to hide Number of Registered users for these kind of events, you can modify code in that same file. Change this line of code from:
Code:
if ($config->show_registered && $item->registration_type != 3)

To
Code:
if ($config->show_registered && $item->registration_type != 3 && $item->event_capacity)

After that, it should work fine

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Petter
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 2 weeks ago #114964 by Petter
That works perfect!

Thank you Tuan ('',)

Please Log in or Create an account to join the conversation.

More
7 years 2 weeks ago #114973 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Conditional display of fields in category view
Great. You should move that modified file to PATH_TO_TEMPLATE/html/com_eventbooking/common folder so that the change won't be lost when you update to future releases of the extension (No need for re-do the change each time you update)

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Petter
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 2 weeks ago #114983 by Petter
I "accidentally" did something like that yesterday by clicking

Extensions > Templates > Templates > selected my template > Create Overrides > Components > com_eventbooking > common

Now there are 34 files in that folder... :ohmy:

Can I safely delete them all and manually copy event_properties.php ?

Rgds,

Petter

Please Log in or Create an account to join the conversation.

More
7 years 2 weeks ago #114985 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Conditional display of fields in category view
Hi Petter

Yes. You can delete these files and only keep event_properties.php file

Maybe making a backup of that whole folder before deleting the files

Tuan

Please Log in or Create an account to join the conversation.

  • Petter
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 2 weeks ago #114986 by Petter
So delete the file even event_properties-20180701-221214.php ?

Please Log in or Create an account to join the conversation.

More
7 years 2 weeks ago #114987 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Conditional display of fields in category view
Yes. Look like it's just a backup file created by someone

Regards,

Tuan
The following user(s) said Thank You: Petter

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc