custom/plugins/TcinnThemeWareLiving/src/Resources/views/storefront/layout/navigation/navigation.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/layout/navigation/navigation.html.twig' %}
  2. {# TODO: prüfen... #}
  3. {# ---------------- START: SET TEMPLATE VARS ---------------- #}
  4. {# ThemeWare: Set theme variables #}
  5. {% set twtIconSet = theme_config('twt-iconset') %}
  6. {% set twtNavMainArrowsShow = theme_config('twt-nav-main-arrows-show') %}
  7. {% set twtNavMainHomeLink = theme_config('twt-nav-main-home-link') %}
  8. {% set twtNavMainHomeLinkCompatibility = theme_config('twt-nav-main-home-link-compatibility') %}
  9. {% set twtNavMainHomeLinkShow = theme_config('twt-nav-main-home-link-show') %}
  10. {% set twtNavMainMenuItemsCompatibility = theme_config('twt-nav-main-menu-items-compatibility') %}
  11. {% set twtNavMainShow = theme_config('twt-nav-main-show') %}
  12. {# ---------------- END: SET TEMPLATE VARS ---------------- #}
  13. {# TODO: HC-Architecture... #}
  14. {# ThemeWare: Adjustments on the main navigation #}
  15. {% block layout_main_navigation %}
  16.     {# ThemeWare: Hide main navigation #}
  17.     {% if twtNavMainShow == 1 or twtNavMainShow == 3 %}
  18.         {# ThemeWare: Block cleared #}
  19.     {% else %}
  20.         {# Default block #}
  21.         {{ parent() }}
  22.     {% endif %}
  23. {% endblock %}
  24. {# ThemeWare: Adjustments on the home link in main navigation #}
  25. {# HC-Architecture @Doku #}
  26. {% block layout_main_navigation_menu_home %}
  27.     {% if twtNavMainHomeLinkCompatibility == 2 %}
  28.         {% if twtNavMainHomeLinkShow > 1 %}
  29.             {# ThemeWare: Add aria-label #}
  30.              <a class="nav-link main-navigation-link{% if controllerAction is same as('home') %} active{% endif %} home-link"
  31.                 href="{{ path('frontend.home.page') }}" aria-label="Home" 
  32.                 itemprop="url"
  33.                 title="{{ "general.homeLink"|trans|striptags }}">
  34.                 {% if twtNavMainHomeLink == 1 %}
  35.                     {# ThemeWare: Home-Text link (default) #}
  36.                     <div class="main-navigation-link-text">
  37.                         <span itemprop="name">{{ "general.homeLink"|trans|sw_sanitize }}</span>
  38.                     </div>
  39.                 {% elseif twtNavMainHomeLink == 2 %}
  40.                     {# ThemeWare: Home-Icon link #}
  41.                     <div class="main-navigation-icon">
  42.                         <span itemprop="name">
  43.                             {% if twtIconSet is not same as ('default') %}
  44.                                 {% sw_icon 'home' style {'pack':'themeware'} %}
  45.                             {% else %}
  46.                                 {% sw_icon 'home' %}
  47.                             {% endif %}
  48.                         </span>
  49.                     </div>
  50.                 {% endif %}
  51.             </a>
  52.         {% else %}
  53.             {# ThemeWare: no icon or text #}
  54.         {% endif %}
  55.     {% else %}
  56.         {# Default block #}
  57.         {{ parent() }}
  58.     {% endif %}
  59. {% endblock %}
  60. {# ThemeWare: Adjustments on the menu items in main navigation #}
  61. {# TODO: HC-Architecture @Doku #}
  62. {% block layout_main_navigation_menu_item %}
  63.     {% if twtNavMainMenuItemsCompatibility == 2 %}
  64.         {% if category.type == 'folder' %}
  65.             <div class="nav-link main-navigation-link"
  66.                     {% if treeItem.children|length > 0 %}
  67.                         data-flyout-menu-trigger="{{ category.id }}"
  68.                     {% endif %}
  69.                  title="{{ name }}">
  70.                 <div class="main-navigation-link-text">
  71.                     <span itemprop="name">{{ name }}</span>
  72.                     {# ThemeWare: Add navigation arrow #}
  73.                     {% if twtNavMainArrowsShow == 2 and treeItem.children|length > 0 %}
  74.                         {% sw_icon 'arrow-medium-down' style { 'pack': 'solid', 'size': 'xs' } %}
  75.                     {% endif %}
  76.                 </div>
  77.             </div>
  78.         {% else %}
  79.             <a class="nav-link main-navigation-link{% if category.id == page.header.navigation.active.id or category.id in activePath %} active{% endif %}"
  80.                href="{{ category_url(category) }}"
  81.                itemprop="url"
  82.                {% if treeItem.children|length > 0 %}data-flyout-menu-trigger="{{ category.id }}"{% endif %}
  83.                     {% if category_linknewtab(category) %}target="_blank"{% endif %}
  84.                title="{{ name }}">
  85.                 <div class="main-navigation-link-text">
  86.                     <span itemprop="name">{{ name }}</span>
  87.                     {# ThemeWare: Add navigation arrow #}
  88.                     {% if twtNavMainArrowsShow == 2 and treeItem.children|length > 0 %}
  89.                         {% sw_icon 'arrow-medium-down' style { 'pack': 'solid', 'size': 'xs' } %}
  90.                     {% endif %}
  91.                 </div>
  92.             </a>
  93.         {% endif %}
  94.     {% else %}
  95.         {# Default block #}
  96.         {{ parent() }}
  97.     {% endif %}
  98. {% endblock %}