templates/components/sub-navigation.html.twig line 1

Open in your IDE?
  1. {%
  2.     set linkAttributes = [
  3.         {icon: 'midwife', color: 'bg-teal'},
  4.         {icon: 'midwifeteam', color: 'bg-dark-teal'},
  5.         {icon: 'wehe', color: 'bg-petroleum'},
  6.     ]
  7. %}
  8. {% if (webspaceSettings.content.links) %}
  9.     <div class="container d-none d-lg-block">
  10.         <div class="row">
  11.             <div class="col-12">
  12.                 <div class="sub-navigation d-flex text-center flex-column flex-md-row align-items-center text-white">
  13.                     {% for item in webspaceSettings.content.links %}
  14.                         <a href="{{ sulu_content_path(item.url, item.webspaceKey) }}" class="{{ active_route(app.request.attributes.get( '_route' ), item.template) ? 'active' }}
  15.                             w-100 py-2 d-inline {{ linkAttributes[loop.index0].color }} {{ loop.index0 == 1 ? 'sub-nav-border' }}">
  16.                             <span class="d-flex justify-content-center align-items-center">
  17.                                 <span class="icon">
  18.                                     {% include '@components/icons/sub-navigation-icons.html.twig' with { icon: linkAttributes[loop.index0].icon } %}
  19.                                 </span>
  20.                                 <span class="ms-2 fs-5 text-white fw-bold me-2">{{ item.title }}</span>
  21.                             </span>
  22.                         </a>
  23.                     {% endfor %}
  24.                 </div>
  25.             </div>
  26.         </div>
  27.     </div>
  28.     <div class="d-lg-none sub-navigation d-flex text-center flex-column flex-md-row align-items-center text-white">
  29.         {% for item in webspaceSettings.content.links %}
  30.             <a href="{{ sulu_content_path(item.url, item.webspaceKey) }}" class="{{ active_route(app.request.attributes.get( '_route' ), item.template) ? 'active' }}
  31.                 w-100 py-2 d-inline {{ linkAttributes[loop.index0].color }} {{ loop.index0 == 1 ? 'sub-nav-border' }}">
  32.                 <span class="d-flex justify-content-center align-items-center">
  33.                     <span class="icon">
  34.                         {% include '@components/icons/sub-navigation-icons.html.twig' with { icon: linkAttributes[loop.index0].icon } %}
  35.                     </span>
  36.                     <span class="ms-2 fs-5 text-white fw-bold me-2">{{ item.title }}</span>
  37.                 </span>
  38.             </a>
  39.         {% endfor %}
  40.     </div>
  41. {% endif %}