templates/management/menu/navbar.html.twig line 1
{% extends 'util/knp_menu.html.twig' %}{% block list %}{% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %}<ul class="navbar-nav">{{ block('children') }}</ul>{% endif %}{% endblock %}{% block item %}{% if item.displayed %}{% if options.depth <= 2 %}<li class="nav-item {{ item.hasChildren ? 'dropdown' : '' }}">{{ block('linkElement') }}</li>{% else %}{{ block('linkElement') }}{% endif %}{% endif %}{% endblock %}{% block children %}{# save current variables #}{% set currentOptions = options %}{% set currentItem = item %}{# update the depth for children #}{% if options.depth is not none %}{% set options = options|merge({'depth': currentOptions.depth + 1}) %}{% endif %}{% for item in currentItem.children %}{{ block('item') }}{% endfor %}{# restore current variables #}{% set item = currentItem %}{% set options = currentOptions %}{% endblock %}{% block linkElement %}{% import _self as knp_menu %}{% if options.depth <= 2 %}{% if item.hasChildren %}{% set active = false %}{% for child in item.children %}{% if matcher.isCurrent(child) %}{% set active = true %}{% endif %}{% endfor %}<a href="{{ item.uri ?? '#' }}"class="nav-link {{ item.hasChildren ? 'dropdown-toggle' : '' }} {{ active ? 'active' : '' }}"data-bs-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ block('label') }}</a>{% else %}<a href="{{ item.uri ?? '#' }}" class="nav-link {% if matcher.isCurrent(item) %}active{% endif %} text-nowrap">{{ block('label') }}</a>{% endif %}{% else %}<a href="{{ item.uri ?? '#' }}"class="dropdown-item {% if matcher.isCurrent(item) %}active{% endif %}">{{ block('label') }}</a>{% endif %}{% if item.hasChildren %}<ul class="dropdown-menu">{{ block('children') }}</ul>{% endif %}{% endblock %}{% block label %}{% if item.getExtra('icon') %}<i class="{{ item.getExtra('icon') }}"></i>{% endif %}{{ parent() }}{% endblock %}