I'm fetching entries from several different locales and merging them together into a single object.
I then want to sort these to be most recent entry shown first.
Using Supersort and the custom sortAs
method I can get this to work showing entries in ascending date order:
{% set sections = 'news' %}
{% set locales = craft.i18n.getSiteLocales %}
{% set pages = [] %}
{% for locale in locales %}
{% set entries = craft.entries.section(sections).status(null).locale(locale.id).localeEnabled(false).find() %}
{% set pages = pages|merge(entries) %}
{% endfor %}
{% set pagesSorted = pages | supersort('sortAs', '{ postDate.date }') %}
However, if I try to use the above with the custom rsortAs
method then it does not work, just returning the entries in the order they occur within the pages object.
Any thoughts on what might be doing wrong?