Answers.Body: <p>The question is a little unclear, is this what you are looking for?</p>
  
  <pre><code>{% set requiredProgram = false %}
  {% for block in entry.workshopInstructor %}
     {% if block.requiredPrograms.contains('Photoshop')%}
        {% set requiredProgram = true %}
     {% endif %}
  {% endfor %}
  
  {% if requiredProgram %}
    Photoshop is enabled on one of this entry's blocks field.
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-12T00:19:27.127Z
Answers.Text: The requiredProgram tag refers to a checkbox field that contains multiple entries. If any of the instructors inputted into the matrix field have a software, I'd like it to display on the main page, but separately on their own inner pages.
  So this code works for the inner page
  
  `{% for block in entry.workshopInstructor[0] %}
       {% if block.requiredPrograms.contains('Photoshop') %}
            foo
       {% endif %}
  {% endfor %}`
  
  
  But won't work for the outer page
  So I need to somehow check if any of the entries have the checkbox ticked and if they do display the software.
Answers.UserDisplayName: JeffTalbot
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-18T04:15:09.803Z
Answers.Text: At first I didn't understand the solution but with a slight bit of codification it works great. Thanks
Answers.UserDisplayName: JeffTalbot
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-11T10:40:32.327Z
Answers.LastActivityDate: 2015-06-11T10:47:02.833Z
Answers.LastEditDate: 2015-06-11T10:47:02.833Z
Answers.UserDisplayName: Luke Holder
Body: <p>I have a check box field called <code>requiredPrograms</code>, in it it has a selection of programs you can choose from. This is within a matrix field called <code>Work shop Instructor</code> which is for my workshop channel.</p>
  
  <p>On my outside workshop page I'd like to display what programs are required for all the teachers at the workshop in the one spot. On the inner page they would be broken into separate programs per instructor.</p>
  
  <p>I've done the inner page with no issue but I cannot figure out a way to do the outer one.</p>
  
  <pre><code>{% for block in entry.workshopInstructor[0] and entry.workshopInstructor[1] %}
     {% if block.requiredPrograms.contains('Photoshop')%}
        &lt;p&gt;Foo&lt;/p&gt;
     {% endif %}
  {% endfor %}
  </code></pre>
  
  <p>That is my current attempt but this results in nothing being displayed and other attempts have only produced the output twice.</p>
  
  <p>Any suggestions?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-11T07:29:22.860Z
Comments.Text: What does ```entry.workshopInstructor[0]``` and ```entry.workshopInstructor[1]``` refer to?
Comments.UserDisplayName: Mats Mikkel Rummelhoff
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-12T00:15:47.970Z
Comments.Text: @mmikkel It refers to the matrix field that I am trying to access. I'd like to check block[0] and block[1] to see if the checkbox Photoshop has been selected. If it is selected on either one I'd like it to display.
Comments.UserDisplayName: JeffTalbot
Tags: <matrix><blocks>
Title: Is it possible to combine information from two blocks from a matrix to an if function?
ThreadText: # Is it possible to combine information from two blocks from a matrix to an if function?
  
  (Asked by: username_0 on 2015-06-11)
  
  I have a check box field called `requiredPrograms`, in it it has a selection of programs you can choose from. This is within a matrix field called `Work shop Instructor` which is for my workshop channel.
  
  On my outside workshop page I'd like to display what programs are required for all the teachers at the workshop in the one spot. On the inner page they would be broken into separate programs per instructor.
  
  I've done the inner page with no issue but I cannot figure out a way to do the outer one.
  
  ```
  {% for block in entry.workshopInstructor[0] and entry.workshopInstructor[1] %}
     {% if block.requiredPrograms.contains('Photoshop')%}
        <p>Foo</p>
     {% endif %}
  {% endfor %}
  
  ```
  
  That is my current attempt but this results in nothing being displayed and other attempts have only produced the output twice.
  
  Any suggestions?
  
  **Tags:** matrix, blocks
  
  > **Comments:**
  > **username_1**: What does ```entry.workshopInstructor[0]``` and ```entry.workshopInstructor[1]``` refer to?  
  > **username_0**: @mmikkel It refers to the matrix field that I am trying to access. I'd like to check block[0] and block[1] to see if the checkbox Photoshop has been selected. If it is selected on either one I'd like it to display.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2015-06-11. Score: 2 | Accepted answer
  
  The question is a little unclear, is this what you are looking for?
  
  ```
  {% set requiredProgram = false %}
  {% for block in entry.workshopInstructor %}
     {% if block.requiredPrograms.contains('Photoshop')%}
        {% set requiredProgram = true %}
     {% endif %}
  {% endfor %}
  
  {% if requiredProgram %}
    Photoshop is enabled on one of this entry's blocks field.
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: The requiredProgram tag refers to a checkbox field that contains multiple entries. If any of the instructors inputted into the matrix field have a software, I'd like it to display on the main page, but separately on their own inner pages. So this code works for the inner page  `{% for block in entry.workshopInstructor[0] %}      {% if block.requiredPrograms.contains('Photoshop') %}           foo      {% endif %} {% endfor %}`   But won't work for the outer page So I need to somehow check if any of the entries have the checkbox ticked and if they do display the software.  
  > **username_0**: At first I didn't understand the solution but with a slight bit of codification it works great. Thanks  
  
  ---
  
  