templates/menu/menu_top.html.twig line 1

Open in your IDE?
  1. {% macro renderItems(item) %}
  2.     {% set action = app.request.requestUri %}
  3.     <li class="{{ action == path(item.route) ? 'is-actual' : '' }}">
  4.         {% set noFollow = '' %}
  5.         {% if item.noFollow == true %}
  6.             {% set noFollow = 'rel="nofollow"' %}
  7.         {% endif %}
  8.         <a class="navbar-main--item js-go-page" {% if item.openNewWindow %}target="_blank"{% endif %} href="{{ item.link ? item.link : path(item.route) }}" {{ noFollow }}>{{ item.text }}</a>
  9.         {% if item.children|length %}
  10.             <ul>
  11.                 {% for child in item.children %}
  12.                     {% if child.enabled %}
  13.                         {{ _self.renderItems(child) }}
  14.                     {% endif %}
  15.                 {% endfor %}
  16.             </ul>
  17.         {% endif %}
  18.     </li>
  19. {% endmacro %}
  20. {% set current_hotel = '' %}
  21. {% if app.request.attributes.get('contentDocument') %}
  22.     {% if app.request.attributes.get('contentDocument') is instance_of('Application\\FrontendBundle\\Entity\\Hotel') %}
  23.         {% set current_hotel = app.request.attributes.get('contentDocument') %}
  24.     {% endif %}
  25.     {% if app.request.attributes.get('contentDocument') is instance_of('Application\\FrontendBundle\\Entity\\Experience') %}
  26.         {% set current_hotel = app.request.attributes.get('contentDocument').hotel %}
  27.     {% endif %}
  28. {% endif %}
  29. {% if items %}
  30.     <nav class="navbar-main is-principal" role="navigation">
  31.         <ul>
  32.             <div class="navbar-main--wrapper">
  33.                 {% include 'menu/hotels_top.html.twig' %}
  34.             </div>
  35.             <div class="navbar-main--wrapper">
  36.                 <span class="navbar-main--title">{{ 'app.global.services'|trans }}</span>
  37.                 <div class="navbar-main--wrapper-items">
  38.                     {% for item in items %}
  39.                         {% if item.route != 'wam_routing_url_5' or item.currentLocale in blog_enabled_locales %}
  40.                             {{ _self.renderItems(item) }}
  41.                         {% endif %}
  42.                     {% endfor %}
  43.                     <li>
  44.                         <a class="navbar-main--item secondary-item js-submenu-open"
  45.                             data-dest="submenu-secondary-reservation">{{ 'menu.submenu.booking'|trans }}
  46.                             <span
  47.                                 class="navbar-main--icon-arrow
  48.                                 special">{% include 'partials/global/svg/icon-arrow-artiem.svg.twig' %}</span>
  49.                         </a>
  50.                     </li>
  51.                 </div>
  52.             </div>
  53.             <div class="navbar-main--wrapper">
  54.                 <span class="navbar-main--title">{{ 'app.global.artiem'|trans }}</span>
  55.                 <div class="navbar-main--wrapper-items">
  56.                     {{ render_menu('TOP_SECONDARY') }}
  57.                     <li>
  58.                         <a class="navbar-main--item js-submenu-open" data-dest="submenu-secondary-artiem">{{ 'menu.submenu.artiem'|trans }}
  59.                         <span
  60.                             class="navbar-main--icon-arrow">{% include 'partials/global/svg/icon-arrow-artiem.svg.twig' %}</span>
  61.                         </a>
  62.                     </li>
  63.                 </div>
  64.             </div>
  65.         </ul>
  66.     </nav>
  67. {% endif %}
  68. {% include 'menu/submenu_top.html.twig' %}
  69. {% include 'menu/submenu_secondary.html.twig' %}