Hi !
I've got a problem that I can't find a solution for...
I've got a website site with differents articles entries that are all childrens of the "home" page.
On the website, I would like them to be sorted by a custom date field defined in the blueprint of articles as "header.datearticle".
At first, I tried to do this in the template :
{% for post in page.find('/home').children.published.order('header.datearticle', 'desc') %}
[Some code]
{% endfor %}
But it didn't work, because "header.datearticle' return a string instead of a date object, and that my dates are dd-mm-yyyy hh:mm, so the ordering is not good.
I tried to do something like
{% for post in page.find('/home').children.published.order('post.header.datearticle|date("U")', 'desc') %}
to change the date to unix time, but it seems that the order function doesn't accept this like this.
Then I thought that maybe I should have change the blueprint of home to ask to change the order of children with something like
content:
order:
by: header.datearticle
dir: asc
But it doesn't change anything and I don't know why. Should "Folder Numeric Prefix" be removed before applying custom order like this ? (I did remove it also, but didn't change anything).
I'm a bit stuck and I don't know what to do...