I am working on a project for my office where we have a series of event assets, each with a metadata schema that provides a field called event_end_date, which is in a date format.
My supervisor wants to have a page which has two sections, one for current events, one for upcoming events. Now, I could of course manually drag them between two page assets and render them that way, but my supervisor wants to automate this process and these events don’t actually end, they simply become future events again once they finish, ie. they repeat annually.
I was trying to figure out how I could go about this, I was thinking of having the default format asset under an asset listing perform a conditional check, something like:
%begin_event_end_date^lt:globals_date%
// This would become a future date, as it has ended
%else_asset%
// This would be a current event, as it still has an end date later than the current date.
For context, I know I need to be more specific in the conditional, to make sure that it checks if the end date is also < the last day of the year, otherwise I will be rendering in both current and future for events with an end date > the current date. This is just a quick example.
However, I can’t think of how the asset listing will be able to ‘assign’ these to a different place on the page, as my understanding is that in the page contents asset of the asset listing, I can only render the asset using %asset_listing%, which doesn’t really provide me an option to ‘position’ where it renders.
Let’s say the page contents file looks something like this:
<section> <strong><span>Current events</span></strong> %asset_listing% </section> <section> <strong><span>Future events</span></strong> %asset_listing% </section>
It doesn’t really work because I can only render the asset using the same keyword, it doesn’t conditionally check anything at this level.
Is there any way for me to have this functionality working? Sorry if it’s a simple question, I’m quite new to Squiz Matrix and am still learning how the keywords and assets interact.
Thank you for any help you can provide!