Jump to content

antoine.s

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by antoine.s

  1. I did try switching but then only the latest created where on top. I guess the latest "news_date" where at the bottom of the list. and the minus signs -news_date|-created seem to work as each field is sorted from newest to oldest, it's just that it generates 2 sorts and it does not mix it all up unfortunately. But thanks for the tip.
  2. 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
×
×
  • Create New...