Hello,
I want to split my main navigation in 2 ul
with specific classes.
I managed to split my navigation :
{% for pages in pages.children.visible |batch(pages.children.visible|length / 2) %}
<ul>
{% for page in pages %}
<li>
<a href="{{ page.url }}">{{ page.menu }}</a>
</li>
{% endfor %}
</ul>
{% endfor %}
This is the ouput :
<nav id="header-nav">
<ul>
<li>
<a href="">Item1</a>
</li>
<li>
<a href="">Item2</a>
</li>
</ul>
<ul>
<li>
<a href="">Item3</a>
</li>
</ul>
</nav>
For now, for the css part I do it this way: ul:first-child
and ul:nth-child(2)
, but how could I add a specific class to each ul
?
Thanks in advance.