Jump to content

How to sort after parent title in PW 2.7.3?


Orkun
 Share

Recommended Posts

Hi Guys

I am trying to sort children pages by their parent title field but it looks like this is only possible in the PW 3 Branch.
I am using the 2.7.3 Version.

This is my selector at the moment, I am also using pagination (limit):

template=specialities-clinics, sort=title, choose_sender_2016={$rootParent->choose_sender_2016}, limit=24

When I try "sort=parent.title" I get the following error:

850840034_Bildschirmfoto2019-12-23um15_03_05.png.b8e94f6063898d95339b8d543f1266de.png

Is there any way/workaround to make this work in the PW 2.7.3 Version?

 

KR
Orkun

Link to comment
Share on other sites

I have solved this now with a second find since it are not much pages (102 since website launch in 2016).

// Workaround

$specificSpecialitiesFilteredByClinic = $pages->find("template=specialities-clinics, sort=title, choose_sender_2016={$rootParent->choose_sender_2016}");

$ids = "";
foreach($specificSpecialitiesFilteredByClinic as $speciality){
  $ids .= $speciality->parent->id."|";
}
$ids = rtrim($ids, "|");

$find = $pages->find("id=$ids, sort=title, limit=24");

KR
Orkun 

  • Like 2
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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