| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 | {#/** * @file * Theme override to display a menu. * * Available variables: * - menu_name: The machine name of the menu. * - items: A nested list of menu items. Each menu item contains: *   - attributes: HTML attributes for the menu item. *   - below: The menu item child items. *   - title: The menu link title. *   - url: The menu link url, instance of \Drupal\Core\Url *   - localized_options: Menu link localized options. *   - is_expanded: TRUE if the link has visible children within the current *     menu tree. *   - is_collapsed: TRUE if the link has children within the current menu tree *     that are not currently visible. *   - in_active_trail: TRUE if the link is in the active trail. */#}{% import _self as menus %}{#  We call a macro which calls itself to render the full tree.  @see http://twig.sensiolabs.org/doc/tags/macro.html#}<div class="navbar navbar-default">  <ul class="nav navbar-nav">    <li class="nav navbar-link">      <a href="#" data-target="#" data-toggle="dropdown">        MSSMat en bref        <span class="caret" />      </a>      <ul class="dropdown-menu dropdown">        <li><a href="#">Organisation</a></li>        <li><a href="#">Production scientifique</a></li>        <li><a href="#">Implication dans l'Enseignement</a></li>        <li><a href="#">Collaborations et Partenariats</a></li>      </ul>    </li>    <li class="nav navbar-link">      <a href="#" data-target="#" data-toggle="dropdown">        Recherche        <span class="caret" />      </a>      <ul class="dropdown-menu dropdown">        <li><a href="#">Equipe Sciences et Ingénierie des Matériaux</a></li>        <li><a href="#">Equipe Sciences et Ingénierie Numérique</a></li>        <li><a href="#">Axe CM3</a></li>        <li><a href="#">Axe DynOdAs</a></li>        <li><a href="#">Axe MPI</a></li>      </ul>    </li>    <li class="nav navbar-link">      <a href="#" data-target="#" data-toggle="dropdown">        Moyens        <span class="caret" />      </a>      <ul class="dropdown-menu dropdown">        <li><a href="#">Logiciels</a></li>        <li><a href="#">Essais Mécaniques</a></li>        <li><a href="#">Microscopie</a></li>        <li><a href="#">Machines de Nanomatériaux</a></li>      </ul>    </li>  </ul></div>{{ menus.menu_links(items, attributes, 0) }}{% macro menu_links(items, attributes, menu_level) %}  {% import _self as menus %}  {% if items %}    {% if menu_level == 0 %}      <ul{{ attributes }}>    {% else %}      <ul>    {% endif %}    {% for item in items %}      <li{{ item.attributes }}>        {{ link(item.title, item.url) }}        {% if item.below %}          {{ menus.menu_links(item.below, attributes, menu_level + 1) }}        {% endif %}      </li>    {% endfor %}    </ul>  {% endif %}{% endmacro %}
 |