{# KnpMenu template for the sidebar (layout_sidebar.html.twig). Items of the first level: - a link (`.sidebar-link`); with children, they show below it while it or a child is current - without a URI but with children: a group that opens in place (
), open while a child is current - extras `heading` (a group heading) or `divider` (a line) - extras `icon`: rendered with _partials/_icon.html.twig (`icon`, `class`), as myep's icon() does #} {% extends 'knp_menu.html.twig' %} {% block list %} {% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %} {% if item.level == 0 %} {% elseif item.uri is empty or matcher.isCurrent(item) or matcher.isAncestor(item) %} {% endif %} {% endif %} {% endblock %} {% block item %} {% if item.displayed and item.extras.heading is defined %} {% elseif item.displayed and item.extras.divider is defined %}

  • {% elseif item.displayed %}
  • {% if item.uri is empty and item.hasChildren and item.displayChildren %} {% else %} {{ block('linkElement') }} {{ block('list') }} {% endif %}
  • {% endif %} {% endblock %} {% block linkElement %} {% import _self as knp_menu %} {% set is_current = matcher.isCurrent(item) %} {{ block('label') }} {% endblock %} {% block label -%} {% if item.extras.icon is defined -%} {{ include('_partials/_icon.html.twig', { icon: item.extras.icon, class: 'size-5 shrink-0 ' ~ (matcher.isCurrent(item) or matcher.isAncestor(item) ? 'text-brand' : 'text-muted'), }) }} {{ item.label }} {%- else -%} {{ item.label }} {%- endif %} {%- endblock %}