AgendaList groupBy sort repeats according to their ID instead of dates

Hi,

I use AgendaList snippet to display events of a specific category… some of them are repeated ones (quite often for some) so i used &groupby =id to display them only once, the closest in time only.

I noticed that the repeating dates (of the subquery probably) are sorted according to their ID, not the startdate. So, if you add a date of recurrence after another one, even if the new one is closer in time, the one you added first is still the one displayed.

Do you have any idea to sort them from closest to furthest in time ?

Can you please post the Snippet call here?

[[!AgendaList?
&wrapperTpl=TplAgendaACCUEILwrapper
&imageTpl=TplAgendaACCUEILimage
&calendars=actualites,agenda
&active=1
&detailId = 271
&categories=accueil
&groupby =id
&sortby = { “all_startdate”:“ASC”}
&daterangeSeparator=<x>-</x>
&tpl=TplAgendaACCUEIL
&locale=fr_FR
&end=today +3 month 0:00 ]]

I tried several &sortby… this is the one in use for now

Note : the values have backticks around… the forum doesn’t render them

You have to add three backticks around your code to be displayed without stripping the backticks inside.

Can you try this:

&groupby=`AgendaEvents.id`

or

&groupby=`AgendaEvents.id`
&sortby=`{ "EventDate.startdate":"ASC" }`

As soon as i add this line :

the snippet stops working and i got no results… not 0 result… just nothing, no output at all