Jump to content

Page Reference field (PageArray) doesn't return results for nested pages


Martin1
 Share

Recommended Posts

Hi!

I have a "company" template with a Page Reference field "sectors" which is linked to a tree of nested pages which all have a "sector" template. It is possible to link to any nested "sector" and, after selecting pages in the admin, the PageArray field doesn't seem to have knowledge of the hierarchy for the selected pages.

However, when I search companies using a subfield search ex:

$pages->find("template=company, sectors.title*=$search");

I'm only getting results of companies when I search the title of any root sectors, and I'm not getting any results when I search the title for any of the nested sectors. It seems that the PageArray field is just looking for the top sectors even though nested sectors are also selected, they all share the same "sector" template and the Page Reference field shouldn't have knowledge about the hierarchy. Is there something I'm misunderstanding?

Thank you

Link to comment
Share on other sites

Ok I get it.

The Page Reference field as a selected "Parent" to allow an easy Page List selection option, this is what affect the search here. If I remove the selected parent, only keep the template and use the AsmSelect instead, then it doesn't affect the search. It's a little less convenient to select in the admin, but I can deal with it.

1769768295_ScreenShot2020-04-29at6_25_55PM.thumb.png.c1c77d06afc019c90d8a5d264eebb1f1.png

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