Limiting instances of Recurring Calendar Events


(Andrew Bull) #1

I’m creating a Calendar Events Search Page that displays both Single and Recurring Calendar Events.
The Single Events occur fairly sporadically, every 2 - 4 weeks, say. But the Recurring Events are weekly sessions.

When I list everything, you see multiple instances of the recurring events, which tend to crowd out the Single events.

For this reason, I want to list only the next instance of the recurring events.

This way, the Recurring events would always be at or near the top, saying “every Monday”, while the less frequent Single events would be easier for the reader to process.

I can set event horizons or limit the maximum number of events per page but this affects the number of both types of event.

Does anyone know if there’s a way to alter the number of Instances shown?


(Peter McLeod) #2

Hi
A couple of ideas - none are probably ideal:

A condition to check if the event start date/time is the same as the instance startdate/time > then show if it is - might work for the first time - but not after the intial start date has past unless you update.

%begin_event_start_datetime_U^replace_keywords:eq:{instance_start_datetime_U}:1:0%
 ....
%end_event%

keep in mind that as you are only hiding / or not print out content in the results listing then the total results won’t match what gets output.

Otherwise could try using custom groupings > group by assetid and limit to 1 asset per group - but might cause problems with the sort order.

Or just use css or js to hide all but the first instance for each reoccuring event.

Thanks
Peter


(Andrew Bull) #3

Thanks Peter

I started thinking along similar lines and came up with:

%begin_instance_start_datetime_U^lt_date:{globals_date_U^add:1209600}%

%end_asset%

…as well as many permutations on the same idea.

This should show any recurring event that starts in the next two weeks. But I just can’t get it to work. As far as I can tell, the nested keyword in this case just doesn’t work.

So, I tried it with:

%begin_instance_start_datetime^lt_date:{globals_date}%

…which should show zero events (because it’s an upcoming list and this tells it not to show anything before today) but all the recurring events still displayed.

If I hard-code the date:

%begin_instance_start_datetime^lt_date:2017-03-14%

…it works, and I get no recurring events after two weeks from today’s date.

But the nested keywords, no matter what I put in, just won’t give a result.

When I put any of the nested keywords into the page display (using %%), they all work fine, but nothing between braces in the conditional keyword has any effect.

Bug? Or am I missing something?


(Bart Banda) #4

There is a weird setting on the Global Preferences screen (no idea why it was added there and not on the Calendar Search Event page) that lets you set the frequency threshold of recurring events.

https://matrix.squiz.net/manuals/system-configuration/chapters/global-preferences#Recurring-Calendar-Event-Preferences

Would this do what you are after?


(Douglas (@finnatic at @waikato)) #5

This has a squizmap idea worth supporting - Move Events frequency threshold setting to details screen of Calendar Search Page asset


(Douglas (@finnatic at @waikato)) #6

The threshold preference says:

… what does that actually mean? Is it a time window (x days ahead / behind of the current day) or something to do with how often the event occurs (every x days) or how many occurrences there are of the event (event occurs every week for x times)?