Jump to content

Check if PageArray already contains a page?


Harmster
 Share

Recommended Posts

Hey,

I've searched for this and I couldn't find it,

what i want to do is check if a page (object) already is in a PageArray field? Ofcourse i can go through it with a loop but if theres already a method to do this then i dont want to re invent the wheel.

Link to comment
Share on other sites

if $idsToExclude are checkboxes and some are checked then those who are checked are excluded.

//$idsToExclude =  fieldtype Page, parent=articles, Multiple pages (PageArray)
$idsToExclude = $page->pageField; 
$articlesWithoutExcluded = $pages->find("parent=/articles/, id!=$idsToExclude");
  • Like 1
Link to comment
Share on other sites

  • 3 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...