I’m looking for a clean way to get all levels of children (children, grandchildren, great-grandchildren, etc) under a specified parent as one group of pages that I can then run a search on.
Alternative, is an easy way to tell the search function to only return items under one or more specific parents without having to loop through them all and checking for the top-level parent.
Maybe I’m looking at this the wrong way, but in looking through search documentation and such I haven’t found anything that looked very clean for doing what I need to do.
Basically, end result in Kirby 2 is to feed it a list of only the specific parents I want to search under (or only the specific parents I don’t want to search under, either way).
Ah, OK, now I’m seeing the comments there that it goes through all the subpages of the page being searched. Very nice.
OK, looks like I can then do something like $results = $pages->find('page-A','page-B')->index()->search(get('q'), 'title|text', array('words' => true))->visible(); (the page('page-A','page-B') above didn’t work, and this bit does require the index() in there).
I can’t seem to feed it an array of parent pages, though. Have to manually put them all in the find statement, but I can live with that.