Take the 2-minute tour ×
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It's 100% free, no registration required.

I have a set of checkboxes to show content on a page. I have one instance where I'd like to show something if either checkboxes are selected. I have searched around but couldn't find how to combine multiple value. Here's what I have now

{% if entry.pageOptions.contains('testimonials') %} 

And I want it to be something like:

{% if entry.pageOptions.contains('anotheroption|testimonials') %} 
share|improve this question

1 Answer 1

up vote 4 down vote accepted

That contains test just does a smple string comparison. Try this:

{% if entry.pageOptions.contains('anotheroption')
     or entry.pageOptions.contains('testimonials') %}
share|improve this answer
    
That worked beautifully - so simple. Thank you! –  David yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.