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

  • 6 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.