Hide custom field depending on date

  • Donna Torr
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 2 months ago #121500 by Donna Torr
Hide custom field depending on date was created by Donna Torr
Hi Guys,

An ever moving goal post on my current project.

Is it possible to add some sort of rule to hide a custom field until a specific date?

Regards
Donna

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

More
7 years 2 months ago - 7 years 2 months ago #121502 by James Riley
Replied by James Riley on topic Hide custom field depending on date
I think you'd have to use javascript or jquery or php to get the current date and inject the appropriate CSS ruleset to either hide or reveal, depending on whether the date has passed or not.

Going the PHP route, You could use something like Regular Labs' Sourcer to handle both the code and CSS injection. See the FAQ article at www.regularlabs.com/extensions/sourcerer...ead-of-the-html-page for a sample of how to use it for adding CSS, or the PHP section of their tutorial www.regularlabs.com/extensions/sourcerer/tutorial#examples-php for samples styling up your PHP code to work with the plugin. You'd include the marked-up code directly into your event's Description.

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 7 years 2 months ago by James Riley. Reason: removed module reference, because its a plugin!! Silly me!

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

More
7 years 2 months ago #121518 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Hide custom field depending on date
Hello

Currently, Events Booking does not support this option. The right way would be adding two settings to custom fields:

- Publish Up
- Publish Down

And then only show these fields (on Registration Form) base on this date duration (same as Joomla core Publish Up/Publish Down for articles)

Since Events Booking does not support this, you will have to customize code yourself if you want to implement this feature

Tuan

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

  • Donna Torr
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 2 months ago #121697 by Donna Torr
Replied by Donna Torr on topic Hide custom field depending on date
Hi Tuan,

Is there a variable I can use to get the event start date within my code?

Regards
Donna

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

More
7 years 2 months ago #121706 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Hide custom field depending on date
Hi Donna

No, unfortunately, there is no variables related to event start date within your code. You will need to find out how to customize the code yourself to have it works for your need

Tuan

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

Moderators: Tuan Pham Ngoc