<p>I'm assuming you are talking about your block type having a Entries field within.</p>

<p>You simply loop through it like this:</p>

<pre><code>{% case 'BlockType3' %}
&lt;div class="row"&gt;
{% for entry in block.entriesFieldHandle %}
    &lt;div class="col"&gt;{{ entry.title }}&lt;/div&gt;
{% endfor %}
&lt;/div&gt;
</code></pre>

CC BY-SA 3.0
2015-05-22T10:48:58.163Z
2015-05-22T10:48:58.163Z
Fred Carlsen
<p>I have a Matrix field with 4 Block types. I loop through them like this</p>

<pre><code>{% for block in entry.MatrixFieldHandle %}
    {% set type = block.type.handle %}

    {% switch type %}
        {% case 'BlockType1' %}
            {{ block.fieldHandle }}

        {% case 'BlockType2' %}
            {{ block.fieldHandle }}
</code></pre>

<p>within one of these cases, I need to loop through the entries:</p>

<pre><code>{% case 'BlockType3' %}
    {% for row in block|batch(2) %}
        &lt;div class="row"&gt;

        {% for block in row %}
            &lt;div class="col"&gt;{{ block.fieldHandle }}&lt;/div&gt;
        {% endfor %}
    &lt;/div&gt;
{% endfor %}
</code></pre>

<p>The html output is close, but I do not get any content displayed. What is wrong?</p>

<matrix>
Loop through entries in a Matrix block type
# Loop through entries in a Matrix block type

(Asked by: username_0 on 2015-05-22)

I have a Matrix field with 4 Block types. I loop through them like this
{% for block in entry.MatrixFieldHandle %}
    {% set type = block.type.handle %}

    {% switch type %}
        {% case 'BlockType1' %}
            {{ block.fieldHandle }}

        {% case 'BlockType2' %}
            {{ block.fieldHandle }}

within one of these cases, I need to loop through the entries:
{% case 'BlockType3' %}
    {% for row in block|batch(2) %}
        

        {% for block in row %}
            {{ block.fieldHandle }}
        {% endfor %}
    
{% endfor %}

The html output is close, but I do not get any content displayed. What is wrong?

**Tags:** matrix

---

## 1 answers

### Answer by username_1 on 2015-05-22. Score: 4 | Accepted answer

I'm assuming you are talking about your block type having a Entries field within.
You simply loop through it like this:
{% case 'BlockType3' %}

{% for entry in block.entriesFieldHandle %}
    {{ entry.title }}
{% endfor %}


---

