custom/static-plugins/NdTheme/src/Resources/views/storefront/layout/breadcrumb.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/layout/breadcrumb.html.twig' %}
  2. {% block layout_breadcrumb_inner %}
  3.     {% if category %}
  4.         {% set breadcrumbCategories = sw_breadcrumb_full(category, context.context) %}
  5.         {% set categoryId = category.id %}
  6.         {% if feature('v6.5.0.0') %}
  7.             {% set breadcrumbKeys = breadcrumbCategories|keys %}
  8.         {% else %}
  9.             {% sw_silent_feature_call "v6.5.0.0" %}
  10.                 {# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
  11.                 {% set breadcrumb = sw_breadcrumb(category) %}
  12.                 {# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
  13.                 {% set breadcrumbKeys = breadcrumb|keys %}
  14.                 {# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
  15.                 {% set breadcrumbTypes = sw_breadcrumb_build_types(breadcrumbCategories) %}
  16.             {% endsw_silent_feature_call %}
  17.         {% endif %}
  18.         {% set isProduct = controllerName === 'Product' %}
  19.         {% if breadcrumbCategories|length > 0 %}
  20.             <nav aria-label="breadcrumb" class="boxed-layout">
  21.                 {% block layout_breadcrumb_list %}
  22.                     <ol class="breadcrumb flex items-center py-2 font-accent text-grey-600 uppercase text-xs"
  23.                         itemscope
  24.                         itemtype="https://schema.org/BreadcrumbList">
  25.                         <div class="breadcrumb-placeholder flex justify-center items-center w-5 h-5 rotate-180 md:hidden">
  26.                             <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
  27.                                  class="w-5 h-5">
  28.                                 <path fill-rule="evenodd"
  29.                                       d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z"
  30.                                       clip-rule="evenodd"/>
  31.                             </svg>
  32.                         </div>
  33.                         <li class="breadcrumb-item items-end{% if breadcrumbCategories|length !== 1 %} hidden{% else %} flex font-bold text-grey-900{% endif %} md:flex md:font-normal md:text-grey-600">
  34.                             <a href="{{ path('frontend.home.page') }}"
  35.                                class="hover:underline"
  36.                                title="{{ "general.homeLink"|trans }}"
  37.                                itemprop="item">
  38.                                 <link itemprop="url"
  39.                                       href="{{ path('frontend.home.page') }}"/>
  40.                                 <span class="breadcrumb-title"
  41.                                       itemprop="name">{{ "general.homeLink"|trans }}</span>
  42.                             </a>
  43.                             <meta itemprop="position" content="0">
  44.                         </li>
  45.                         <div class="breadcrumb-placeholder hidden justify-center items-center w-5 h-5 rotate-180 md:rotate-0 md:flex">
  46.                             <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
  47.                                  class="w-5 h-5">
  48.                                 <path fill-rule="evenodd"
  49.                                       d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z"
  50.                                       clip-rule="evenodd"/>
  51.                             </svg>
  52.                         </div>
  53.                         {% for breadcrumbCategory in breadcrumbCategories %}
  54.                             {% set key = breadcrumbCategory.id %}
  55.                             {% set name = breadcrumbCategory.translated.name %}
  56.                             {% set productDirectParent = controllerName === 'Product' and key is not same as (categoryId) %}
  57.                             {% set categoryDirectParent = controllerName !== 'Product' and loop.revindex === 1 %}
  58.                             {% if loop.first and loop.last %}
  59.                             {% endif %}
  60.                             {% block layout_breadcrumb_list_item %}
  61.                                 <li class="breadcrumb-item {% if isProduct and key is not same as(categoryId) %}hidden md:block{% endif %} {% if not isProduct and loop.revindex === 1 %}hidden md:block{% endif %}"
  62.                                     {% if key is same as(categoryId) %}aria-current="page"{% endif %}
  63.                                     itemprop="itemListElement"
  64.                                     itemscope
  65.                                     itemtype="https://schema.org/ListItem">
  66.                                     {% if breadcrumbCategory.type == 'folder' %}
  67.                                         <div itemprop="item">
  68.                                             <div itemprop="name">{{ name }}</div>
  69.                                         </div>
  70.                                     {% else %}
  71.                                         <a href="{{ category_url(breadcrumbCategory) }}"
  72.                                            class="breadcrumb-link hover:underline {% if isProduct and key is same as(categoryId) %} is-active text-grey-900 font-bold{% endif %} {% if not isProduct and loop.revindex === 2 %} is-active text-grey-900 font-bold md:font-normal md:text-grey-600{% endif %} {% if not isProduct and loop.revindex === 1 %} md:font-bold md:text-grey-900{% endif %}"
  73.                                            title="{{ name }}"
  74.                                            {% if category_linknewtab(breadcrumbCategory) %}target="_blank"{% endif %}
  75.                                            itemprop="item">
  76.                                             <link itemprop="url"
  77.                                                   href="{{ category_url(breadcrumbCategory) }}"/>
  78.                                             <span class="breadcrumb-title" itemprop="name">{{ name }}</span>
  79.                                         </a>
  80.                                     {% endif %}
  81.                                     <meta itemprop="position" content="{{ loop.index }}"/>
  82.                                 </li>
  83.                             {% endblock %}
  84.                             {% block layout_breadcrumb_placeholder %}
  85.                                 {% if key != breadcrumbKeys|last %}
  86.                                     <div class="breadcrumb-placeholder w-5 h-5 items-center justify-center hidden md:flex">
  87.                                         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
  88.                                              class="w-5 h-5">
  89.                                             <path fill-rule="evenodd"
  90.                                                   d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z"
  91.                                                   clip-rule="evenodd"/>
  92.                                         </svg>
  93.                                     </div>
  94.                                 {% endif %}
  95.                             {% endblock %}
  96.                         {% endfor %}
  97.                     </ol>
  98.                 {% endblock %}
  99.             </nav>
  100.         {% endif %}
  101.     {% endif %}
  102. {% endblock %}