33 lines
1.6 KiB
Twig
33 lines
1.6 KiB
Twig
{% if categories %}
|
|
<div class="container">
|
|
<nav id="menu" class="navbar navbar-expand-lg navbar-light bg-primary">
|
|
<div id="category" class="d-block d-sm-block d-lg-none">{{ text_category }}</div>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#narbar-menu"><i class="fa-solid fa-bars"></i></button>
|
|
<div class="collapse navbar-collapse" id="narbar-menu">
|
|
<ul class="nav navbar-nav">
|
|
{% for category in categories %}
|
|
{% if category.children %}
|
|
<li class="nav-item dropdown"><a href="{{ category.href }}" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">{{ category.name }}</a>
|
|
<div class="dropdown-menu">
|
|
<div class="dropdown-inner">
|
|
{% for children in category.children|batch(category.children|length / category.column|round(1, 'ceil')) %}
|
|
<ul class="list-unstyled">
|
|
{% for child in children %}
|
|
<li><a href="{{ child.href }}" class="nav-link">{{ child.name }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endfor %}
|
|
</div>
|
|
<a href="{{ category.href }}" class="see-all">{{ text_all }} {{ category.name }}</a>
|
|
</div>
|
|
</li>
|
|
{% else %}
|
|
<li class="nav-item"><a href="{{ category.href }}" class="nav-link">{{ category.name }}</a></li>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
</div>
|
|
{% endif %}
|