Forum

Thread tagged as: Question, Runway

Collections Query Sort Order

Hi,

Is it possible to get the perch_collection query to use the same sort order as the Collection items in the admin section?

When I reorder the Collection items in the admin, this isn't reflected on my front-end pages (using the perch_collection query).

I've tried setting sort order in the perch_collection query to "_order", but no luck.

Thanks.

Robert Chambers

Robert Chambers 0 points

  • 6 years ago
Simon Clay

Simon Clay 127 points

Hi Robert,

<?php
    perch_collection('Your Collection', [
        'template'   =>'template.html'
    ]); 
?>

should output the items in the order they are in admin by default.

Hi Simon,

Yes, I thought the same, but my perch_collection is in that format, but it's not using the admin order:

<?php
    perch_collection('Articles', [
        'template'  =>  'articles.html',
    'count'     =>  10,
        'paginate'  => true
    ]);
?>

Using the debug, looks like it's using the order from perch2_collection_index, rather than perch2_collection_revisions.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you using the latest version?

Yes, Perch Runway: 2.7.5

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, I'll take another look at it!

Hi Drew,

Any luck with solving this?

Thanks.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Did you update to 2.7.6 and are still seeing the issue?

https://grabaperch.com/update