Answers.Body: <p>Your above code is not working because you are using "block" instead of "item" in your children. So...</p>
  
  <pre><code>{% for item in block.children %}
      {% switch item.type.handle %}
  </code></pre>
  
  <p>You don't necessarily need to do a switch here, you could do a series of includes and make their file names match your block type... so "_includes/neo/box.twig" and "_includes/neo/image.twig"</p>
  
  <p>In the example below I am replacing "item" with "child" to explain it better.</p>
  
  <pre><code>{% for block in entry.MatrixNeo.level(1) %}
        &lt;h2&gt;{{ block.mainTitle }}&lt;/h2&gt;
        {% for child in block.children %}
             {% include "_includes/neo/" ~ child.type %}
        {% endfor %}
      {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-01T13:42:48.883Z
Answers.LastActivityDate: 2016-09-01T13:42:48.883Z
Answers.UserDisplayName: AbbeyDesign
Answers.Body: <p>You must call the inner blocks (level2, level3 and so on) like the first level</p>
  
  <pre><code>{% if entry.bodyMain is defined and entry.bodyMain | length %}
      {% nav block in entry.bodyMain.level(1) %}
          {% switch block.type.handle %}
  
              {% case 'accordion' %}
                  &lt;ul class="accordion accordion-2"&gt;
  
                      {% nav block in block.children %}
                          {% switch block.type.handle %}
  
                              {% case 'timeBlock' %}
                                  &lt;li&gt;
                                      &lt;a class="opener" href="#"&gt;{{ block.heading }}&lt;/a&gt;
                                      &lt;div class="slide"&gt;
                                          {{ block.body }}
                                      &lt;/div&gt;
                                  &lt;/li&gt;
  
                          {% endswitch %}
                      {% endnav %}
  
                  &lt;/ul&gt;
  
          {% endswitch %}
      {% endnav %}
  {% endif %}
  </code></pre>
  
  <p>Or you can do it like this:</p>
  
  <pre><code>{% if entry.bodyMain is defined and entry.bodyMain | length %}
      {% nav block in entry.bodyMain.level(1) %}
          {% switch block.type.handle %}
  
              {% case 'accordion' %}
                  &lt;ul class="accordion accordion-2"&gt;
                      {% for block in block.children %}
                          {% include "_includes/_blocks/" ~ block.type %}
                      {% endfor %}
                  &lt;/ul&gt;
  
          {% endswitch %}
      {% endnav %}
  {% endif %}
  </code></pre>
  
  <p>For that you must build a file with this content:</p>
  
  <pre><code>&lt;li&gt;
      &lt;a class="opener" href="#"&gt;{{ block.heading }}&lt;/a&gt;
      &lt;div class="slide"&gt;
          {{ block.body }}
      &lt;/div&gt;
  &lt;/li&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-05T06:45:56.310Z
Answers.LastActivityDate: 2017-10-05T06:45:56.310Z
Answers.UserDisplayName: The Frog
Body: <p>I have a question. How can I output the Childs from a Neo (Neo Plugin) Block?</p>
  
  <p>With this code, i get the output for all level 1 blocks but i don't get a output for the deeper levels.</p>
  
  <p>And how can I handle different child templates for the Output?</p>
  
  <p>My idea is to have a switch with different case for the level 2 output. Because i've different child block options.</p>
  
  <pre><code>{% for block in entry.MatrixNeo.level(1) %}
      {% switch block.type.handle %}
  
          {% case 'title' %}
              &lt;h2&gt;{{ block.mainTitle }}&lt;/h2&gt;
  
  
          {% case 'boxes' %}
               &lt;h2&gt;{{ block.mainTitle }}&lt;/h2&gt;   
  
              {% for item in block.children %}
                  {% switch block.type.handle %}
  
                      {% case 'box' %}
                          &lt;h2&gt;{{ block.mainTitle }}&lt;/h2&gt;
  
                          {% case 'image' %}
                          &lt;h2&gt;{{ block.mainTitle }}&lt;/h2&gt;
  
                  {% endswitch %}
              {% endfor %}
  
      {% endswitch %}
  {% endfor %}
  </code></pre>
  
  <p>Can somebody help me out, please?</p>
  
  <p>=====================</p>
  
  <p>UPDATE</p>
  
  <p>Now my code works fine but i've a new questione:</p>
  
  <p>How can i output a real Matix-Field in a child element (level 2 in Neo).</p>
  
  <p>My Code:</p>
  
  <pre><code>{% nav block in entry.myField.level(1) %}
      {% switch block.type.handle %}
          {% case 'title' %}
              &lt;hgroup&gt;
                  &lt;h2&gt;{{ block.mainTitle }}&lt;/h2&gt;
                  &lt;h4&gt;{{ block.subTitle }}&lt;/h4&gt;
              &lt;/hgroup&gt;
  
          {% case 'intro' %}
              &lt;section class="block"&gt;
                  {% for item in block.children %}
                      {% include "_includes/elements/" ~ item.type %}
                  {% endfor %}
              &lt;/section&gt;
  
      {% endswitch %}
  {% endnav %}
  </code></pre>
  
  <p>The child Code:</p>
  
  <pre><code>&lt;div class="box"&gt;
      &lt;h2&gt;{{ item.mainTitle }}&lt;/h2&gt;
  
      {% for button in block.myButton %}
          {% switch button.type %}
              {% case 'buttonIntern' %}
                  &lt;a class="button" href="{{ button.linkIntern }}"&gt;{{ button.linkText }}&lt;/a&gt;
  
              {% case 'buttonExtern' %}
                  &lt;a class="button" target="_blank" href="{{ button.linkIntern }}"&gt;{{ button.linkExtern }}&lt;/a&gt;
  
          {% endswitch %}
      {% endfor %}
  
  &lt;/div&gt;
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-08-31T19:08:33.687Z
Comments.Text: Is `MatrixNeo` a native [Matrix](https://craftcms.com/docs/matrix-fields) field or a [Neo](https://github.com/benjamminf/craft-neo) field from the Neo plugin? And what type of field is `children` in `block.children`?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-01T06:26:52.897Z
Comments.Text: Yes, the Neo-Plugin. My idea is to have a `switch` with different `case` in the level 2 output. Because i've different child block options.
Comments.UserDisplayName: The Frog
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-05T12:49:17.053Z
Comments.Text: Per your updated question. When I see people putting a Matrix within a Neo my first question is why? I can't think of any reason(there might be some) that if you've committed to using NEO, you'd need a Matrix field. You could create a "button" block type in NEO which has two children; one External Link and one Internal Link and use the same code approach as the original answer.
Comments.UserDisplayName: AbbeyDesign
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-05T13:12:33.820Z
Comments.Text: Per your updated code, maybe the issue is you have button.linkIntern as the link in your buttonExtern call.
Comments.UserDisplayName: AbbeyDesign
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-08T07:53:40.833Z
Comments.Text: You are right, it make no sense at all. Now I build it as a Neo block, but I can't output the button in the 3th level with the some technic as the level 2 blocks. Can you tell me how to output the 3th level blocks.
Comments.UserDisplayName: The Frog
Tags: <layout><plugin-neo>
Title: Craft Neo – childs Output
ThreadText: # Craft Neo – childs Output
  
  (Asked by: username_0 on 2016-08-31)
  
  I have a question. How can I output the Childs from a Neo (Neo Plugin) Block?
  
  With this code, i get the output for all level 1 blocks but i don't get a output for the deeper levels.
  
  And how can I handle different child templates for the Output?
  
  My idea is to have a switch with different case for the level 2 output. Because i've different child block options.
  
  ```
  {% for block in entry.MatrixNeo.level(1) %}
      {% switch block.type.handle %}
  
          {% case 'title' %}
              <h2>{{ block.mainTitle }}</h2>
  
          {% case 'boxes' %}
               <h2>{{ block.mainTitle }}</h2>   
  
              {% for item in block.children %}
                  {% switch block.type.handle %}
  
                      {% case 'box' %}
                          <h2>{{ block.mainTitle }}</h2>
  
                          {% case 'image' %}
                          <h2>{{ block.mainTitle }}</h2>
  
                  {% endswitch %}
              {% endfor %}
  
      {% endswitch %}
  {% endfor %}
  
  ```
  
  Can somebody help me out, please?
  
  =====================
  
  UPDATE
  
  Now my code works fine but i've a new questione:
  
  How can i output a real Matix-Field in a child element (level 2 in Neo).
  
  My Code:
  
  ```
  {% nav block in entry.myField.level(1) %}
      {% switch block.type.handle %}
          {% case 'title' %}
              <hgroup>
                  <h2>{{ block.mainTitle }}</h2>
                  <h4>{{ block.subTitle }}</h4>
              </hgroup>
  
          {% case 'intro' %}
              <section class="block">
                  {% for item in block.children %}
                      {% include "_includes/elements/" ~ item.type %}
                  {% endfor %}
              </section>
  
      {% endswitch %}
  {% endnav %}
  
  ```
  
  The child Code:
  
  ```
  <div class="box">
      <h2>{{ item.mainTitle }}</h2>
  
      {% for button in block.myButton %}
          {% switch button.type %}
              {% case 'buttonIntern' %}
                  <a class="button" href="{{ button.linkIntern }}">{{ button.linkText }}</a>
  
              {% case 'buttonExtern' %}
                  <a class="button" target="_blank" href="{{ button.linkIntern }}">{{ button.linkExtern }}</a>
  
          {% endswitch %}
      {% endfor %}
  
  </div>
  
  ```
  
  **Tags:** layout, plugin-neo
  
  > **Comments:**
  > **username_1**: Is `MatrixNeo` a native [Matrix](https://craftcms.com/docs/matrix-fields) field or a [Neo](https://github.com/benjamminf/craft-neo) field from the Neo plugin? And what type of field is `children` in `block.children`?  
  > **username_0**: Yes, the Neo-Plugin. My idea is to have a `switch` with different `case` in the level 2 output. Because i've different child block options.  
  > **username_2**: Per your updated question. When I see people putting a Matrix within a Neo my first question is why? I can't think of any reason(there might be some) that if you've committed to using NEO, you'd need a Matrix field. You could create a "button" block type in NEO which has two children; one External Link and one Internal Link and use the same code approach as the original answer.  
  > **username_2**: Per your updated code, maybe the issue is you have button.linkIntern as the link in your buttonExtern call.  
  > **username_0**: You are right, it make no sense at all. Now I build it as a Neo block, but I can't output the button in the 3th level with the some technic as the level 2 blocks. Can you tell me how to output the 3th level blocks.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2016-09-01. Score: 2 | Accepted answer
  
  Your above code is not working because you are using "block" instead of "item" in your children. So...
  
  ```
  {% for item in block.children %}
      {% switch item.type.handle %}
  
  ```
  
  You don't necessarily need to do a switch here, you could do a series of includes and make their file names match your block type... so "\_includes/neo/box.twig" and "\_includes/neo/image.twig"
  
  In the example below I am replacing "item" with "child" to explain it better.
  
  ```
  {% for block in entry.MatrixNeo.level(1) %}
        <h2>{{ block.mainTitle }}</h2>
        {% for child in block.children %}
             {% include "_includes/neo/" ~ child.type %}
        {% endfor %}
      {% endfor %}
  
  ```
  
  
  ---
  
  ### Answer by username_0 on 2017-10-05. Score: 1
  
  You must call the inner blocks (level2, level3 and so on) like the first level
  
  ```
  {% if entry.bodyMain is defined and entry.bodyMain | length %}
      {% nav block in entry.bodyMain.level(1) %}
          {% switch block.type.handle %}
  
              {% case 'accordion' %}
                  <ul class="accordion accordion-2">
  
                      {% nav block in block.children %}
                          {% switch block.type.handle %}
  
                              {% case 'timeBlock' %}
                                  <li>
                                      <a class="opener" href="#">{{ block.heading }}</a>
                                      <div class="slide">
                                          {{ block.body }}
                                      </div>
                                  </li>
  
                          {% endswitch %}
                      {% endnav %}
  
                  </ul>
  
          {% endswitch %}
      {% endnav %}
  {% endif %}
  
  ```
  
  Or you can do it like this:
  
  ```
  {% if entry.bodyMain is defined and entry.bodyMain | length %}
      {% nav block in entry.bodyMain.level(1) %}
          {% switch block.type.handle %}
  
              {% case 'accordion' %}
                  <ul class="accordion accordion-2">
                      {% for block in block.children %}
                          {% include "_includes/_blocks/" ~ block.type %}
                      {% endfor %}
                  </ul>
  
          {% endswitch %}
      {% endnav %}
  {% endif %}
  
  ```
  
  For that you must build a file with this content:
  
  ```
  <li>
      <a class="opener" href="#">{{ block.heading }}</a>
      <div class="slide">
          {{ block.body }}
      </div>
  </li>
  
  ```
  
  
  ---
  
  