Jorge Posted June 14, 2023 Share Posted June 14, 2023 Hi. I'm trying to accomplish something like this: $entriesByArea = $admitted->find("areas[0].title='$area', sort=-average, limit=$limit"); I want to find items where the first item of the field areas (a repeater) has the title = $area. Is this possible in any way? Thank you. Link to comment Share on other sites More sharing options...
Robin S Posted June 14, 2023 Share Posted June 14, 2023 You could use a hidden field in the template to store the title of the first repeater item, similar to this: Or you could match the repeater page by sort position and then get the containing page for each matched repeater page. $items = $pages->find("template=repeater_areas, title=$area, page.sort=0, check_access=0"); $results = new PageArray(); foreach($items as $item) { // Get root page that contains the repeater page $result = $item->getForPageRoot(); // Maybe do some checks on $result page here, for example if you only want pages that have a particular template $results->add($result); } 1 Link to comment Share on other sites More sharing options...
Jorge Posted June 16, 2023 Author Share Posted June 16, 2023 Hi @Robin S. I've used a new PageArray as you suggested. Thank you. Link to comment Share on other sites More sharing options...
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