Answers.Body: <pre><code>{% cache %}
    {% set entry = craft.entries.slug('team').last() %}
    {% for field in entry.getFieldLayout().getFields() %}
      {% if field.getField().type == "Matrix" %}
        {% set fieldHandle = field.getField().handle %}
        {% set matrixBlocks = entry.__get(fieldHandle).find() %}
        {% for block in matrixBlocks %}
          {{ block.team_name }}
        {% endfor %}
      {% endif %}
    {% endfor %}
  {% endcache %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-18T15:49:02.847Z
Answers.LastActivityDate: 2014-11-18T15:49:02.847Z
Answers.UserDisplayName: Mark Notton
Body: <p>I came across a specific situation where I needed to list out all the values within a collection of Matrix fields on a single entry page. </p>
  
  <p>More specifically, I had a single entry that needed multiple team groups, each with the name, role, and description of various people. I then wanted to list them all out anywhere on the site (single or entry pages). </p>
  
  <p>Hope this solution helps people out. Feel free to critique.</p>
  
Tags: <matrix>
Title: How to list all Matrix Blocks from anywhere, using a slug?
ThreadText: # How to list all Matrix Blocks from anywhere, using a slug?
  
  (Asked by: username_0 on 2014-11-18)
  
  I came across a specific situation where I needed to list out all the values within a collection of Matrix fields on a single entry page.
  
  More specifically, I had a single entry that needed multiple team groups, each with the name, role, and description of various people. I then wanted to list them all out anywhere on the site (single or entry pages).
  
  Hope this solution helps people out. Feel free to critique.
  
  **Tags:** matrix
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2014-11-18. Score: 1 | Accepted answer
  
  ```
  {% cache %}
    {% set entry = craft.entries.slug('team').last() %}
    {% for field in entry.getFieldLayout().getFields() %}
      {% if field.getField().type == "Matrix" %}
        {% set fieldHandle = field.getField().handle %}
        {% set matrixBlocks = entry.__get(fieldHandle).find() %}
        {% for block in matrixBlocks %}
          {{ block.team_name }}
        {% endfor %}
      {% endif %}
    {% endfor %}
  {% endcache %}
  
  ```
  
  
  ---
  
  