Show a list of pages based on metadata date compared to today

Hi everyone,


I'm struggling with working how to do something that seems like it should be straightforward. Here's what I want to acheive:



1 - A bunch of standard pages with a metadata date for 'meeting date'



2 - Have a list that looks like this:



Upcoming meetings

(shows all pages where metadata_meeting_date is > today)



Past meetings

(shows all pages where metadata_meeting_date is < today)





I tried a Whats New list, but it seems I can only set date ranges using standard asset date properties, not a metadata date.

So I'm currently thinking of having another metadata value, a select with values of 'future|past' and use triggers to switch that based on the meeting date metadata, and then use Asset list groups to list based on that value. But that seems a bit long winded, is there a better way?



Many thanks all!

Charlie.

Have you tried a paint layout conditional on the metadata value?

Hi Aleks,


I did think about a paint layout, but I'm not sure how it would work with the results. Here's what I think might happen:



Asset list finds 100 results, displays 20 per page, so has 5 pages in the pagination.

Paint layout is applied to each result, and only 50 of them match the condition, so the visible list is then 50 results, which should make the pagination just 3 pages.

But because the paint layout is applied to individual results, the asset list still thinks it has 100 results and so will still show 5 pages in the pagination.



Would that happen?

Or is there another way to apply a paint layout to stop that happening?



Thanks!

Charlie.

Charlie, yes that would happen - the pagination would be a bit off.


But, do you need to have paginated results?

Hi Aleks,


Unfortunalty, yes, it will need to be paginated. The lists are for all our committee meetings (we have lots of committee meetings!) and will get rather long, so will need to be paginated to split them up. (or split by yearly date headers, but if I can't split the list based on the date then I can't do this either!).



Its looking like I'll have to use another metadata field, and get it to switch from 'future' to 'past' when the current date matches the metadata meeting date. And put in a request for Whats New listings to be able to use metadata dates!



Thanks,

Charlie.

How about using two folders (one for future meetings and one for past meetings) and type-2 linking the page assets depends on the metadata value? Then use them as filters for the asset listing.


You can use a trigger to remove the type-2 link on 'expiry' of the metadata value.

Mmmm… that might work!
So authors create all the pages in the 'future' folder, and then a trigger moves the page out of the 'future' folder and into the 'past' folder when the metadata date is reached?

I'll have a test with that and will post back!



Thanks again Aleks!

C ;o)

Yup, you can do it that way. I am 99% sure it will work. :wink: give it a shot!