{% extends 'knp_menu.html.twig' %} {% block item %} {% import 'knp_menu.html.twig' as macroattr %} {% if item.displayed %} {# building the class of the item #} {# displaying the item #} {%- set classes = ["list-inline-item"] %} {% if item.name == "52349" %} {%- set classes = classes|merge(['calendar']) %} {% endif %} {%- set attributes = item.attributes %} {%- if classes is not empty %} {%- set attributes = attributes|merge({'class': classes|join(' ')}) %} {%- endif %} {# displaying the item #} {%- if item.uri is not empty and (not matcher.isCurrent(item) or options.currentAsLink) %} {{ block('linkElement') }} {%- else %} {{ block('spanElement') }} {%- endif %} {# render the list of children#} {{ block('list') }} {% endif %} {% endblock %} {% block linkElement %} {% import 'knp_menu.html.twig' as macroattr %} {%- set linkAttributes = item.linkAttributes|merge({ 'class': 'link-dark'}) %} {{ block('label') }} {% if item.hasChildren and item.level is not same as(0) and item.displayChildren %}{%- 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 %} {# update the matchingDepth for children #} {% if options.matchingDepth is not none and options.matchingDepth > 0 %} {% set options = options|merge({'matchingDepth': currentOptions.matchingDepth - 1}) %} {% endif %} {% for item in currentItem.children %} {{ block('item') }} {% endfor %} {# restore current variables #} {% set item = currentItem %} {% set options = currentOptions %} {% endblock %} {% block list %} {% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %} {% endif %} {% endblock %}