Torsten Baldes Posted November 1, 2016 Posted November 1, 2016 Hi, i'm looking for a way/selector to get all pages which have a pagefield with multiple selected pages (think tags), but only if the first page in this pagefield matches the given id. My selector looks like this right now: $pages->find('template=trip, tripdata_category='.$page); This gets me all the trips which have the current category at any position in the pagefield tripdata_category . But what i want is, to get only the trips which have this category at the first position in this pagefield. Is this possible with a selector or do i have to filter the results in some way? Thanks!
Zeka Posted November 1, 2016 Posted November 1, 2016 My suggestion $temp = $pages->find('template=trip, tripdata_category='.$page); $trips = new PageArray(); foreach($temp as $tp) { if($tp->tripdata_category->first() == $page) $trips->add($tp); } 3
Torsten Baldes Posted November 2, 2016 Author Posted November 2, 2016 Thanks, that's what i thought. I will try this. Thanks!
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