sujag Posted April 3, 2021 Posted April 3, 2021 I'm stuck with the selector syntax for a page reference field. After changing the site structure the old query $regionEvents = $pages->find("template=veranstaltung,selectLocation.parent=$reg,limit=$limit"); won't work any more, cause I now need a match for the grandparent of the page that is stored in the "selectLocation" page reference field. Just changing to $regionEvents = $pages->find("template=veranstaltung,selectLocation.has_parent=$reg,limit=$limit"); results in a syntax error "Unknown subfield: has_parent" What would be the right syntax in this case?
BitPoet Posted April 3, 2021 Posted April 3, 2021 Have you tried this: $regionEvents = $pages->find("template=veranstaltung,selectLocation.parent.parent=$reg,limit=$limit"); If this doesn't work, a subselector might be the tool of choice: $regionEvents = $pages->find("template=veranstaltung,selectLocation=[template=location,has_parent=$reg],limit=$limit"); 1
sujag Posted April 3, 2021 Author Posted April 3, 2021 Thanks for the suggestion. This works without syntax error, but doesn't give the expected results. Looking for a single (known) parent works. $regionEvents = $pages->find("template=veranstaltung,selectLocation.parent=14692,limit=$limit");
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