I have a food recipe site and have a conditional date applied (via my templates) to show “Thanksgiving Recipes”, “Christmas Recipes”, etc. to appear in the Nav Nest Menu items between a specific date range. The problem is, for the date, a calendar pops up, and I’m bound to use that to select a static date of mm/dd/yyyy from the calendar. However, I want to make these holiday menu items to disappear after they’re over. Currently, it all works great but, I’ll have to manually change the dates every year. I have many other planned ideas for conditional usage so, I prefer to automate this with a mm/dd range for every year, for example. Also, I tried a few things to type directly into the text displayed of the date but couldn’t figure out how to remove the year requirement of the hard-coded date selection. So, does there happen to be a list of codes somewhere (that I can refer to) so I can replace the hard-coded date that the calendar selection populates in that text box?
Thanks for any types of options for that entry into the text box. Hopefully, I won’t have to do separate scripting and I can just hear someone mention some variable values I can use, e.g., “12/25/yyyy” (to represent Dec. 25th of any year).
Tapping into the date box forces a pop-up calendar. After some work, I can get rid of the prompt and remove the populated date from that text box then, I tried several of the formatted date styles you referenced by the date time documentation.
Thanks but, unfortunately, it doesn’t save that property when using dynamic variables from that list. It appears to only store a hard-coded date as selected from its popup calendar.
Thanks vey much Ferry. This was extremely helpful. I chose a method without the slashes and eventually worked out what needed to happen. So, I updated my user guide. Here’s what I can share, more specifically for other beginners like myself. Again, you were very helpful and I appreciate it a lot!!!
1.4 Adding Conditions to a Menu Item
1.4.1 Making a Menu Item Visible for a Date Range, Repeated Yearly Automatically
An example of usage is to have specific holiday categories appear only during their general interest dates. Here is an example to follow for navigational menu item “Thanksgiving Recipes” to appear only between October 1stANDNovember 30th.
While in Bricks Edit mode, on the right “Structure” frame, tap the desired navigational menu item, e.g., “Thanksgiving Recipes” (named internally as “Thanksgiving DateRange” so it’s noticeable).
Then, on the left frame for its “Components”, tap on the “Conditions” icon.
The top & bottom will represent the date range, separated by the “AND” condition.
In the top part (representing the FROM date), tap the “Date” dropdown arrow and select “Dynamic data”.
In the “Dynamic data” text box below it, tap the lightning bolt icon and select “Current Date (UTC)”.
Modify the added variable “{current_date}" to now be {current_date:md}
In the next text box, select the “>=” symbol.
Finally, type in the 2 digit month and 2 digit day, e.g., for October 1st, enter: 1001.
After the “AND” connector, in the bottom part (representing the TO date), tap the “Date” dropdown arrow and select “Dynamic data”.
In the “Dynamic data” text box below it, tap the lightning bolt icon and select “Current Date (UTC)”.
Modify the added variable “{current_date}” to now be {current_date:md}
In the next text box, select the “<=” symbol.
Finally, type in the 2 digit month and 2 digit day for being the last date for this menu item to be visible, e.g., November 30th, enter: 1130.
Important: Tap to <Save> changes.
(see attached image for a visual representation).