We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum


Thread tagged as: Question, Runway

Showing collection item in order newest first

How would I output a collection in date order starting with the newest without the user having a date field in the editor?

I though about using <perch:content type="hidden"> but not sure how I could get the current date into a .html template.

Is it possible to order by the itemID of a collection item?

Nick Bramwell

Nick Bramwell 5 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Try using

'sort' => '_date', 
'sort-order' => 'DESC',

Thanks Drew that works perfectly, is that in the documentation somewhere that I’ve missed?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think so, but you should be able to see it with <perch:showall />.

Thanks I’d not thought of using <perch:showall /> I’ll try to remember about it in future.