devsmo Posted September 11, 2018 Posted September 11, 2018 Hello, Sorting a set of pages based on subfields seems to work quite well. Both of these have worked just fine for us: sort=parent.name sort=customers.title However sorting based on a parent pages subfield doesn't seem to work sort=parent.customer.title Is there some trick for this., or should I just write my own array sorter before printing my content? My actual selector looks something like this: <?php // get stuff $items = array(); $items[] = 'template=entry'; $items[] = 'product.category=ilmoitukset|liitteet'; $items[] = 'sort=product'; $items[] = 'sort=parent.customer.title'; // <-- this does not work /* ... */ $items = $pages->find(implode(", ", $items)); We use Processwire version 3.0.62 at the moment.
Zeka Posted September 11, 2018 Posted September 11, 2018 @devsmo I'm not sure that you can use this type of construction for sorting. Take a look at Ryan's comment https://github.com/processwire/processwire-issues/issues/263#issuecomment-304285290 2
devsmo Posted September 11, 2018 Author Posted September 11, 2018 Thanks! In our case the dataset is fairly small, so I can do the sorting in code. I imagine this could be a pretty annoying problem in some more complex projects. Hope Ryan gets around to this one at some point ?
bernhard Posted September 11, 2018 Posted September 11, 2018 You can do many kinds of sorting/counting/aggregating using RockFinder quite easily and efficiently, I just posted an example: 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now