Torsten Baldes Posted November 1, 2016 Share 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! Link to comment Share on other sites More sharing options...
Zeka Posted November 1, 2016 Share 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 Link to comment Share on other sites More sharing options...
Torsten Baldes Posted November 2, 2016 Author Share Posted November 2, 2016 Thanks, that's what i thought. I will try this. Thanks! 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