Forum

Thread tagged as: Question

perch_content_custom : 'sort-order' using page order from within Perch page orde...

Is it possible to use the order in which the pages appear within the Perch page tree (which the user can change using the reorder function) to order content via perch_content_custom?

Here is how I am pulling in content :

perch_content_custom('project section', array(
    'page'=>'/work/*',
    'template' => 'grid-section.html',
  ));

At the moment it seems to use date edited, which is not really what I want at the moment

Damon Golding

Damon Golding 1 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It's not. The content is sourced from multiple pages but sorted on its own merit.

Is there any way of controlling the order?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You can use sort and sort-order

Would it possible to add the pageTreePosition value to the perch_content_custom output?

I have managed to get the pageTreePosition value to be available in my template the same as _page, _pageID etc but alas I can not sort my content using it.

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, because Perch is retrieving content items based on their page, but nothing about the page itself.

You can't sort based on page.