Jump to content

Recommended Posts

Posted

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.

Posted

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
  • 3 years later...
Posted

This works... why wouldn't simply has(1339) work?

<?php if ($article->article_tags->has("id=1339")) : ?>is-event<?php endif; ?>

 

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
×
×
  • Create New...