Unable to sort by "EventDateStart"

I am attempting to display a list of events in chronological order, where the order is determined by “EventDateStart”; however, Treepl CMS appears to ignore “EventDateStart” and is determining order by either “releasedate” or “LastUpdatedDate”, which causes events to be displayed out of order. We’ve attempted a variety of things, but here’s what is currently used in the site:

{% component source: “Event”, layout: “Event Home List”, filterBy: “releasedate”, sortBy: “EventDateStart”, sortOrder: “ASC”, limit: “4”, type: “module” %}

Any assistance you can render would be greatly appreciated.

I have the same issue on this page which also takes a long time to load:

https://discover-blairgowrie.trialsite.co/barba/barba-meetings

Removing the Event list makes the page load quickly.

Hi @timrayl. My tests also confirm EventDateStart is not working for the sortBy parameter.
I’ll post as a bug if not already there.
As a workaround, you might be able to use this Liquid sorting trick to sort your collection:

{% component source: "Event", layout: "List", type: "module", collectionVariable: "myEvents" %}
{% assign sortType = 'EventDateStart' %}
{% assign sorteditems = myEvents.items | sort: sortType %}
<ul>
    {% for event in sorteditems %}
    <li>{{event.name}} - {{event.EventDateStart}}</li>
    {% endfor %}
</ul>

and if you need those results in reverse order just add | reverse filter after the sort filter:

{% assign sorteditems = myEvents.items | sort: sortType | reverse %}

1 Like

Hi @Adam.Wilson. Thanks so much for confirming the bug, and especially for sharing this Liquid sorting trick. I’ll give it a try right now!

Any update on this bug?

Hi @coder1919
Yes, this bug has been fixed.

Thanks! Figured it out.