Conditions failing for Calendar Events


(Eliseo Dannunzio) #1

Hi everyone,

 

I've been at this for over a day... And I've tried a number of solutions that seem to work in debug (read: "outputting the result on the screen"), but when using these results for conditions seem to fail every single time...

 

I have a page that I've styled slightly different to display details of single and recurring calendar events... I'm pulling the data using

%global_get_event%

, pulling the event parameter off my URL, and then chaining

^as_asset:<attribute>

to obtain the value of the attribute.

 

Now the tricky part is, because I'm dealing with both single calendar events as well as recurring calendar events, I needed to display different code to show the start and end date-times for these events. Enter conditions...

 

Also, enter difficulty getting these conditions to work...

 

My first attempt was using my first logical condition, called condRecurring:

%globals_get_event^as_asset:asset_type^contains:Recurring Calendar Event%

which yields 1 (recurring event) or 0 (single event)... Excellent, I think... I try plugging in the code in Page Contents and give it a whirl:

%begin_condRecurring%
<code for displaying recurring event times>
%else_condRecurring%
<code for displaying single event times>
%end_condRecurring%

Testing with both recurring and single events, it's still showing the code for displaying the time for recurring events...

 

I've tried another logical condition for checking if %globals_get_event^as_asset:event_frequency% returns a value or not, as well as a Keyword Regex condition to check if %globals_get_event^as_asset:asset_type% returns a value with the word "Recurring" in it...

 

Once again in both instances, I'm getting the code for displaying the time for recurring events for both single and recurring events...

 

Any idea what I'm missing?

 

I'm running Squiz Matrix 5.3.2.1, and testing on a Windows machine with Chrome, Firefox and IE... all three browsers return the same responses... And I've verified this with _nocache to make sure it wasn't a caching issue... It hasn't been...

 

Any insight into what I may be doing wrong would be appreciated...

 

~ Eliseo

 


(Anthony Ponomarenko) #2

Howdy,

 

I would suggest that you use a Calendar Event Search Page asset and set up the Dynamic Parameters to source the event from the Get Parameter.

 

Then set up the Display Formats of the Search Page to contain both Single and Recurring Events to display what you want for each particular type.

 

You can take a look at the manuals page for more details: 

 

https://matrix-manuals.squiz.net/calendar/chapters/calendar-events-search-page.