Jump to content

Recommended Posts

Posted

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.

 

 

Posted

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 ?

Posted

You can do many kinds of sorting/counting/aggregating using RockFinder quite easily and efficiently, I just posted an example: 

 

 

  • Like 1

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