custom/static-plugins/NdVoorwindenTheme/src/Resources/views/storefront/layout/navigation/offcanvas/item-link.html.twig line 1

Open in your IDE?
  1. {% if not bottomMenu %}
  2.     {% set item = item.category %}
  3. {% endif %}
  4. {% set isActive = item.id == activeId %}
  5. {% set hasChildren = item.visibleChildCount > 0 %}
  6. {% set url = category_url(item) %}
  7. {% set name = item.translated.name %}
  8. {% set level = item.level %}
  9. {# Check for SALE menu item, as this will need specific styling #}
  10. {# {% set sale = item.id == '828c5896f4ba43cc80cd9656f2f47c82' %} #}
  11. {% set sale = item.customFields and 'custom_is_highlight' in item.customFields|keys and item.customFields.custom_is_highlight %}
  12. {% set has_margin_bottom = item.customFields and 'custom_has_bottom_margin' in item.customFields|keys and item.customFields.custom_has_bottom_margin %}
  13. <li class="navigation-offcanvas-list-item">
  14.     {% block layout_navigation_offcanvas_navigation_categories_list_category_item_link %}
  15.         <a class="navigation-offcanvas-link nav-item nav-link flex justify-between items-center p-4 text-sm font-bold transition hover:text-grey-600 lg:ml-page
  16.                     {% if isActive %} active text-grey-200{% endif %}
  17.                     {% if hasChildren and level < 3 %} js-navigation-offcanvas-link{% endif %}
  18.                     {% if sale %}btn btn-white text-red-500 text-lg font-bold px-8 py-4 mt-2{% endif %}
  19.                     {% if has_margin_bottom %}mb-20{% endif %}
  20.                 "
  21.            href="{{ url }}"
  22.                 {% if hasChildren and level < 3 %}
  23.                     data-href="{{ path('frontend.menu.offcanvas', {'navigationId': item.id}) }}"
  24.                 {% endif %}
  25.            itemprop="url"
  26.                 {% if category_linknewtab(item) %}target="_blank"{% endif %}
  27.            title="{{ name }}"
  28.            data-level="{{ level }}">
  29.             {% block layout_navigation_offcanvas_navigation_categories_list_category_item_link_text %}
  30.                 <span itemprop="name">{{ name }}</span>
  31.                 {% if hasChildren and level < 3 %}
  32.                     {% block layout_navigation_offcanvas_navigation_categories_list_category_item_link_icon %}
  33.                         <span class="navigation-offcanvas-link-icon js-navigation-offcanvas-loading-icon text-white">
  34.                             {% sw_icon 'chevron-right' style { 'pack':'theme-icons', 'class': ' w-5 h-5' } %}
  35.                         </span>
  36.                     {% endblock %}
  37.                 {% endif %}
  38.             {% endblock %}
  39.         </a>
  40.     {% endblock %}
  41. </li>