Hi guys,
Background:
Following on from yesterdays question, currently working on an existing project where the infrastructure isn't ideal so I'm working around what I can.
Currently working on an "Events" page and an "Archived Events" page, the issue being that the organisation has unfortunately not set these up as "Single Calendar Event" items but rather News Items as well as Standard Page assets :(
The goal:
Currently trying to make Events automated by comparing a metadata date field with the current date. Idea being that if the event has a value less than todays date it isn't listed on the "Events" page. The opposite true of the "Archived Events" page (past events are shown on this page).
Currently users are sorting between these two by moving items to different folders (current events and past events). Each page having an asset list pointing to the respective folder. This isn't ideal and can occasionally lead to old items being shown if people forget about events that have finished.
To get around this, I am intending to use conditional keywords on the asset list to determine if the date has passed or not, however I can't seem to get the date comparison keywords working properly.
The problem:
The gte_date keyword seems completely non-functional for me no matter what combinations I use. Simple or complex. The default format for my asset list is as follows:
%begin_asset_metadata_PublishedDateOverride^date_format:Y-m-d^replace_keywords:gte_date:{globals_date^date_format:Y-m-d}% <div class="event %asset_metadata_Type% mix"> <div class="details"> <p> %asset_metadata_PublishedDateOverride^date_format:d M Y%<br/> %globals_date^date_format:d M Y% %begin_asset_metadata_DateRangeLabel% <i class="fa fa-calendar">%asset_metadata_DateRangeLabel%</i> <br> %end_asset_metadata_DateRangeLabel% %begin_asset_metadata_TimeLabel% <i class="fa fa-clock-o"></i> %asset_metadata_TimeLabel%</p> %end_asset_metadata_TimeLabel% </div> <div class="description"> <h2>%asset_name_linked_to_link_url%</h2> %asset_attribute_summary% </div> </div> %end_asset_metadata_PublishedDateOverride^date_format:Y-m-d^replace_keywords:gte_date:{globals_date^date_format:Y-m-d}%
PublishedDateOverride is a Date metadata field that users can set themselves (and defaults to asset_published_date if not set).
Actual output:
All items are being printed currently regardless of their date :(
I have tinkered with the above by even reducing it to a simple
%begin_asset_published^lte_date:{globals_date}% stuff %end_asset_published^lte_date:{globals_date}%
to no avail.
Solutions?:
My asset list is set up and working fine as intended, this conditional is stumping me though to only showing future dated items. I may be thinking about this the wrong way however. It's unfortunate that the person who initially set up the site used News Items rather than Calendar Events, as I can't really change it at this point with so many future events in the format of a News Item :(
Happy to provide more info as needed
Misc. Info:
Squiz Matrix v5.3.4.0 (should be fine to use the date comparison keyword?)
Chrome Version 52.0.2743.116 (64-bit)
OSX 10.11.6