I'm new to Craft CMS. I have the following single level navigation code:
<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:
<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>