<p>You take the same approach as the original child.</p>

<p>So you'd nest a <code>{% for 3rdChild in item.children %}</code> in your <code>{% for item in block.children %}</code></p>

CC BY-SA 3.0
2016-09-21T20:51:11.283Z
2016-09-21T20:51:11.283Z
AbbeyDesign
<p>Not tested – I've no idea if the <a href="https://craftcms.com/docs/templating/nav" rel="nofollow"><code>{% nav %}</code></a> tag even works properly with Neo, but assuming it does, you're not actually rendering the children for each <code>block</code> with your current code. This might do it:</p>

<pre><code>{% nav block in entry.myField.level(1) %}

    {% switch block.type.handle %}

        {% case 'title' %}
            &lt;h2&gt;{{ block.title }}&lt;/h2&gt;

        {% case 'blocks' %}
            {% for item in block.children %}
                {% include "_includes/elements/" ~ item.type %}
             {% endfor %}

    {% endswitch %}

    {% ifchildren %}
        {% children %}
    {% endifchildren %}

{% endnav %}
</code></pre>

CC BY-SA 3.0
2016-09-21T20:35:10.567Z
2016-09-21T20:35:10.567Z
Mats Mikkel Rummelhoff
<p>I have a Neo Field: I want to work with blocks up to 3 levels deep.</p>

<p>My output code works fine: </p>

<pre><code>{% nav block in entry.myField.level(1) %}
    {% switch block.type.handle %}
        {% case 'title' %}
            &lt;h2&gt;{{ block.title }}&lt;/h2&gt;

        {% case 'blocks' %}
             {% for item in block.children %}
                 {% include "_includes/elements/" ~ item.type %}
             {% endfor %}

    {% endswitch %}
{% endnav %}
</code></pre>

<p>But how can I output the deeper block levels? 
I don't find any way to do this.</p>

<matrix>
Neo Children Output
# Neo Children Output

(Asked by: username_0 on 2016-09-21)

I have a Neo Field: I want to work with blocks up to 3 levels deep.
My output code works fine: 
{% nav block in entry.myField.level(1) %}
    {% switch block.type.handle %}
        {% case 'title' %}
            {{ block.title }}

        {% case 'blocks' %}
             {% for item in block.children %}
                 {% include "_includes/elements/" ~ item.type %}
             {% endfor %}

    {% endswitch %}
{% endnav %}

But how can I output the deeper block levels? 
I don't find any way to do this.

**Tags:** matrix


---

## 2 answers

### Answer by username_1 on 2016-09-21. Score: 3

You take the same approach as the original child.

So you'd nest a `{% for 3rdChild in item.children %}` in your `{% for item in block.children %}`


---

### Answer by username_2 on 2016-09-21. Score: 1

Not tested – I've no idea if the {% nav %} tag even works properly with Neo, but assuming it does, you're not actually rendering the children for each block with your current code. This might do it:
{% nav block in entry.myField.level(1) %}

    {% switch block.type.handle %}

        {% case 'title' %}
            {{ block.title }}

        {% case 'blocks' %}
            {% for item in block.children %}
                {% include "_includes/elements/" ~ item.type %}
             {% endfor %}

    {% endswitch %}

    {% ifchildren %}
        {% children %}
    {% endifchildren %}

{% endnav %}


---

