Conditional Date keywords work for event but not Upcoming Event List


(James Porich) #1

Matrix Version: 5.3.4.0

Hi guys,

Making an Events page and I’ve run in to some really confusing results when trying to do some (what I think) simple date comparisons:

My events shouldn’t show an “end date” if less than or equal to the start date (i.e. not set or same day)

On my event page, I have this working as intended, however when I go to the Upcoming Events List to list out the same functionality, the conditional isn’t working???

%begin_asset_metadata_dateFrontend%

    %asset_metadata_dateFrontend% <!-- arbitrary date users can override with -->

%else_begin_event_start_date^replace_keywords:gte_date:{event_end_date}%  <!-- this works on the event page, but not the Upcoming Events List -->

   %event_start_date^date_format:d M Y%

%else_event% <!-- Upcoming events list is reverting to this final condition -->

    %event_start_date^date_format:d M Y% to <br/>
    %event_end_date^date_format:d M Y% <!-- the appended end date -->

%end_event%

Any idea why there would be such a difference in functionality between the event page and the Upcoming Events List?


(James Porich) #2

Ok guys, not getting any answers yet, so just expanding on this one in case it isn’t as clear what I’m getting at. See the attached screen shots below for the conditional keywords on my Upcoming Events List and my Single Calendar Events Paint Layout and the relative outputs:

Image 1: I have set up my page hoping that I will show a single date or a date range depending on whether the event is on a single day or covers multiple days.


Image 2: … Nope :frowning:

Image 3: I have a paint layout determining the format of a Single Calendar Event Page to the exact same logic Image 4: … This works fine?


(Anthony Ponomarenko) #3

Hi James,

We have seen a similar issue in the past, where the conditional keywords are not being evaluated correctly in the else statements. It looks like this is the same issue here. I will log this as a bug, however in the meantime you could use this workaround to get it going the way you wanted.

%begin_asset_metadata_dateFrontend%

<p>
    %asset_metadata_dateFrontend% <!-- arbitrary date users can override with -->
</p><!-- this works on the event page, but not the Upcoming Events List -->

%else_asset%

%begin_event_start_date^replace_keywords:gte_date:{event_end_date}%
<p>
  %event_start_date^date_format:d M Y% 
</p><!-- Upcoming events list is reverting to this final condition -->
%else_event%
<p>
  %event_start_date^date_format:d M Y% to <br> %event_end_date^date_format:d M Y% <!-- the appended end date --> 
</p>
%end_event%

%end_asset%


(Anthony Ponomarenko) #4

Hey James,

I have logged this as a bug here - https://squizmap.squiz.net/matrix/10006

Seems to be that if the keyword in the Begin Else is different to the Begin, it will not evaluate as expected.


(James Porich) #5

Hi Pono,

That solution you posted seems to work for what I was doing. Thanks for logging that as a bug (somewhat reassuring when it’s not just my brain struggling to logic!)

Thanks!


(Anthony Ponomarenko) #6

Hey James.

Just thought I’d let you know that this has now been fixed and will be included in the next Matrix releases - 5.3.5.0 and 5.4.0.0


(James Porich) #7

Thanks Pono! I’ll keep an eye out for it :slight_smile: