sujag Posted February 18, 2020 Posted February 18, 2020 I'm having trouble by finding the right syntax for accessing ancestors of a page Reference field in a selector. I need to find all pages with a given template that include a page reference to some descendants of a given page. Working query is $regionEvents = $pages->find("template=veranstaltung,selectLocation.parent=$page,eventTime>$curYearStart")->sort('selectLocation'); but after changing site structure I need to find not only references to direct children, but also to grandchildren. I tried "selectLocation.has_parent=$page" but this throws an error "Unknown subfield: has_parent" Is this simply a syntax problem or do I need another way to find the pages I need?
sujag Posted February 18, 2020 Author Posted February 18, 2020 Thanks, this gave me indeed the necessary hint. a two step query seems to do, what I'm after $regionLocations = $pages->find("has_parent=$page"); $regionEvents = $pages->find("template=veranstaltung,selectLocation=$regionLocations,eventTime>$curYearStart")->sort('selectLocation');
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