Hello I've build a fairly big website. On of the key part was a event calendar - with events as resources.
Now I'm urgently looking for a solution how to filter out past events from upcoming events.
Date for events is set in TV date. I've tryed to use &where parameter but don't know how to filter it against current date.
Is there a clean way to do it ? With ditto It was fairly easy?
Lucas.
-
MODX Staff
- 10,725 Posts
If it's a TV, you'll have to use tvFilters, but it does not support ranges or operators other than == or || at the moment.
-
☆ A M B ☆
- 309 Posts
I have a site that lists events with each event being a resource. I set the UNpublish date for a resource to be the date after the event (or midnight on the day of). It's not ideal, but it works as long as your getResources call is only looking for published resources.
Yeas,
but what You then do to list and view unpublished resources?
-
☆ A M B ☆
- 309 Posts
This method prevents past events from showing up at all. Do you need to be able to list past events?
I need to see the past events also.
Question - when you set an unpublish date for a document and the date passes and the document becomes unpublished, does the unpublish date stay recorded for the resource?
I have some records with expiry date I need to filter and sort. It seems I can't do this with tvDates. Using the unpub date is an idea but I need to keep a record of the date after the document is unpublished.
John