Answers.Body: <p>You could use the <code>children</code> tag:</p>
  
  <pre><code>{% set entries = craft.entries.section('products') %}
  &lt;ul&gt;
      &lt;li&gt;
          &lt;a href="/products" class="app-nav__primary"&gt;Products&lt;/a&gt;
          &lt;ul class="app-nav__secondary"&gt;
              {% nav entry in entries %}
                  &lt;li&gt;
                      &lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;
                      {% ifchildren %}
                          &lt;ul&gt;
                              {% children %}
                          &lt;/ul&gt;
                      {% endifchildren %}
                  &lt;/li&gt;
              {% endnav %}
          &lt;/ul&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-18T02:37:01.943Z
Answers.LastActivityDate: 2015-12-18T02:37:01.943Z
Answers.UserDisplayName: JMP
Body: <p>I'm new to Craft CMS. I have the following single level navigation code:</p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>&lt;ul&gt;
    &lt;li&gt;
      &lt;a href="/products" class="app-nav__primary"&gt;Products&lt;/a&gt;
      &lt;ul class="app-nav__secondary"&gt;
        {% for entry in craft.entries.section('products') %}
        &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;
        &lt;/li&gt;
        {% endfor %}
      &lt;/ul&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  
  
  <p>How would i adjust this to show a second level navigation in within the parent li? I'm looking for something like this:</p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>&lt;ul&gt;
    &lt;li&gt;
      &lt;a href="/products" class="app-nav__primary"&gt;Products&lt;/a&gt;
      &lt;ul class="app-nav__secondary"&gt;
        {% for entry in craft.entries.section('products') %}
        &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;
          if (child) { '
            &lt;li&gt;&lt;a href="child.link"&gt;child.title&lt;/a&gt;
          }
          &lt;/li&gt;
          {% endfor %}
      &lt;/ul&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  
  
Tags: <entries><navigation>
Title: Simple nested navigation
ThreadText: # Simple nested navigation
  
  (Asked by: username_0 on 2015-12-18)
  
  I'm new to Craft CMS. I have the following single level navigation code:
  
  ```html
  <ul>
    <li>
      <a href="/products" class="app-nav__primary">Products</a>
      <ul class="app-nav__secondary">
        {% for entry in craft.entries.section('products') %}
        <li><a href="{{ entry.url }}">{{ entry.title }}</a>
        </li>
        {% endfor %}
      </ul>
    </li>
  </ul>
  
  ```
  
  How would i adjust this to show a second level navigation in within the parent li? I'm looking for something like this:
  
  ```html
  <ul>
    <li>
      <a href="/products" class="app-nav__primary">Products</a>
      <ul class="app-nav__secondary">
        {% for entry in craft.entries.section('products') %}
        <li><a href="{{ entry.url }}">{{ entry.title }}</a>
          if (child) { '
            <li><a href="child.link">child.title</a>
          }
          </li>
          {% endfor %}
      </ul>
      </li>
  </ul>
  
  ```
  
  **Tags:** entries, navigation
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-12-18. Score: 3
  
  You could use the `children` tag:
  
  ```
  {% set entries = craft.entries.section('products') %}
  <ul>
      <li>
          <a href="/products" class="app-nav__primary">Products</a>
          <ul class="app-nav__secondary">
              {% nav entry in entries %}
                  <li>
                      <a href="{{ entry.url }}">{{ entry.title }}</a>
                      {% ifchildren %}
                          <ul>
                              {% children %}
                          </ul>
                      {% endifchildren %}
                  </li>
              {% endnav %}
          </ul>
      </li>
  </ul>
  
  ```
  
  
  ---
  
  