Answers.Body: <p>How about:</p>
  
  <pre><code>{% for block in entry.myMatrix if block.subsection == 'intro' %}
      ...
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-12T16:55:49.917Z
Answers.Text: This displays an error for me: "Internal Server Error
  
  Craft\MatrixBlockModel and its behaviors do not have a method or closure named "subsection"."
Answers.UserDisplayName: cmal
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-12T17:19:43.080Z
Answers.Text: Can you post a screenshot of your Matrix field? I just want to make sure I'm visualizing it correctly.
Answers.UserDisplayName: Tyler Willingham
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-12T17:45:39.013Z
Answers.Text: Tyler: Here is a [screenshot](http://cl.ly/image/1H0x1H3J0L1k). I made some of the names more generic than my actual case (obviously I don't call my Matrixes "myMatrix"!) but the scenario is still the same. More realistic code based on this screenshot would be `{% for block in entry.approachBlurb if block.subsection('team') %}`
Answers.UserDisplayName: cmal
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-12T18:09:07.613Z
Answers.Text: I replicated your setup and tested against block.subsection == 'research'. I updated my answer with a functioning conditional :) Let me know if this still doesn't work for you.
Answers.UserDisplayName: Tyler Willingham
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-12T03:41:26.330Z
Answers.LastActivityDate: 2014-07-12T18:08:21.950Z
Answers.LastEditDate: 2014-07-12T18:08:21.950Z
Answers.UserDisplayName: Tyler Willingham
Body: <p>I'm in the context of an Entry that has a Matrix field, and one of those Matrix fields is a Dropdown called <code>subsection</code>. I want to grab all Matrix blocks that have <code>subsection</code> set to 'intro'.</p>
  
  <p>This is how I'm trying to do it and it definitely doesn't work. Is there another way to accomplish this?</p>
  
  <pre><code>{% for block in entry.myMatrix.subsection('intro') %}
  …
  {% endfor %}
  </code></pre>
  
Tags: <templating><matrix>
Title: Return all Matrix blocks with a drop down set to a specified value
ThreadText: # Return all Matrix blocks with a drop down set to a specified value
  
  (Asked by: username_0 on 2014-07-11)
  
  I'm in the context of an Entry that has a Matrix field, and one of those Matrix fields is a Dropdown called `subsection`. I want to grab all Matrix blocks that have `subsection` set to 'intro'.
  
  This is how I'm trying to do it and it definitely doesn't work. Is there another way to accomplish this?
  
  ```
  {% for block in entry.myMatrix.subsection('intro') %}
  …
  {% endfor %}
  
  ```
  
  **Tags:** templating, matrix
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-07-12. Score: 3 | Accepted answer
  
  How about:
  
  ```
  {% for block in entry.myMatrix if block.subsection == 'intro' %}
      ...
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_0**: This displays an error for me: "Internal Server Error  Craft\MatrixBlockModel and its behaviors do not have a method or closure named "subsection"."  
  > **username_1**: Can you post a screenshot of your Matrix field? I just want to make sure I'm visualizing it correctly.  
  > **username_0**: username_1: Here is a [screenshot](http://cl.ly/image/1H0x1H3J0L1k). I made some of the names more generic than my actual case (obviously I don't call my Matrixes "myMatrix"!) but the scenario is still the same. More realistic code based on this screenshot would be `{% for block in entry.approachBlurb if block.subsection('team') %}`  
  > **username_1**: I replicated your setup and tested against block.subsection == 'research'. I updated my answer with a functioning conditional :) Let me know if this still doesn't work for you.  
  
  ---
  
  