Jump to content

Recommended Posts

Posted

Hello,

please excuse if this has been discussed before. I was wondering if I can sort a pages array by the admin sort order of items in a pages field?

Explanation: I have several pages which all have one category attached to it (in a single item pages field). These categories are sorted in a specific way in the backend. I would now like to sort the pages so the ones from the first category show up first etc. I would really like to avoid splitting things up and iterating over categories as well. Second option might be to add 1, 2, 3 or something to the category names and later strip it for display but I was wondering if there is a more ProcessWire-y way of doing this 🙂

This is what didn't work:

$pages->find("template=members,sort=kategorie.sort,sort=title);

* EDIT *

It does work! Sorry! (Ican't find an option to delete this post ...)

 

Thanks

thomas

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...