I am trying to sort the output of a forloop in Grav CMS by a custom field from my template Blueprint. I have an event page with child pages of the actual events. I'm trying to loop through the child pages and sort the output by a custom field that uses a date. In a nutshell, show the latest events sorted by date. Currently my loop only outputs by page order and not by the custom date field.
Blueprint (custom date field)
header.overview.datestart:
type: datetime
label: Start Date #PLUGIN_ADMIN.DATE
toggleable: true
Front-End
{% set this_year = "now"|date('M d Y') %}
{% for feature in page.find('/events').children().order('feature.header.overview.datestart').slice(0, 3) %}
<li>
{{ feature.title }}
{{ feature.header.overview.datestart|date("M d Y") }}
</li>
{% endfor %}
The above code outputs the correct data but not in the order I need. Any help would be appreciated.