Hi,
I'm sorry if this has been adressed before but I couldn't find anything about it.
I'm pretty new to processwire but not to php or object developpment.
I'm working on a blog and the request was to add a custom date field on articles that allows the user to override the "date" associated to the article. It's basically a publish date.
If set, that date is used to sort the article and also if the date is in the future the article will not be displayed on the website.
Here is the selector I used to sort my articles list before:
$pages->find('template=news, sort=-created, limit=4');
and here is how I do it now :
$pages->find('template=news,!news_date>today, sort=-created|-news_date, limit=4');
The only issue is that the sort does not sort a big mashup of all the dates regardless of whether it's in "created" or "news_date" but it sorts one and then the other.
So what I get is a list of dates like this
02 jul 2015 (news_date)
15 Jul 2014 (news_date)
2 Dec 2014 (created)
1 Nov 2014 (created)
The news_date list is on top of the created list.
Do you know how I could achieve this?
Thanks a lot