I have an events search page, but I want it to only show future events, not ones that have passed, in the results, and I'm stuck on how to do this for recurring events.
Ideally, on an Events search page, the 'Restrict results date range' on the Search Fields screen should allow you to choose the event date, rather than its created or last updated date... seems kinda obvious to me but guess its never been added to a feature request list. Any Squiz staff want to add it to such a list, please make my day ;-)
So for single calendar events, I have a trigger that fires up when the event is updated, and its sets a future status of 'archive' at the event end time. Perfect. No old events showing up anywhere.
But, how do I do this for recurring events? I can't put the whole event into archive, as some instances are still in the future. But I don't want past instances showing in my search results?
If you are using the calendar events search page, on the search fields screen, can't you just select upcoming events in the Events Filter Fields section? That should work with recurring events as well and only show upcoming dates.
That sounds promising, but looking at the Search Fields screen I'm not sure how I set that up?
I have a field for 'date_range' so that users can pick a From and To date. How do I combine that so that whatever date range they pick will only show dates from that range but also dates only in the future?
That date_range field is set to allow empty searches, so if the users searches on a keyword and doesn't pick a date range it will return all results matching that keyword - but I'd like it to then only show future events.
Thanks again,
Charlie
PS - Thanks for the suggestion Nic, but I don't really want to use javascript to hide events, as that messes up things like pagination where Matrix things there are 3 pages of events, but if you hide a page worth's then the results and the pages don't match up anymore.
Hi Charlie, I had a similar issue when searching recurring events using the Calendar Events Search Page.. I decided to only show a recurring event once in the search results page. To do this,
Go to System Configuration > Global Preferences drop-down.. at the very bottom is an option for Recurring Calendar Event Preferences.
I have set this to 70 which means recurring events only display once unless they recur at intervals longer than 70 days (which none of mine do).. so each recurring event only displays once in the search results.
Not sure if this is what you are after.. I use it for events that are a series of classes such as yoga classes, where people sign-up for a term.
I have a field for 'date_range' so that users can pick a From and To date. How do I combine that so that whatever date range they pick will only show dates from that range but also dates only in the future?
That date_range field is set to allow empty searches, so if the users searches on a keyword and doesn't pick a date range it will return all results matching that keyword - but I'd like it to then only show future events.
If you are letting users pick a start and end date, and you only want dates in the future to be selected, you'd probably have to restrict the date picker with JS. I would use something like a jquery calendar widget plugin to do this, http://keith-wood.name/calendarspicker.html
If the user doesn't pick a date range, you could just use JS to default the events filter field to upcoming events perhaps?
Yup, seems like adding in some JS somewhere along the process is my only option. Which is a pain as I'm not great at JS.
Still seems crazy to me that on an EVENTS search page asset, the restrict results by date bit doesn't allow you to choose the event date, only standard asset dates. That would solve my problem in one easy click.
Please can you add this into the 'features needed in Matrix so it makes just a bit more sense' development list? ;o)
Agreed, had a look in Squizmap, seems it has already bee added by Anthony not too long ago, probably as a result from previous discussions on the forums as well: