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

Open in your IDE?
  1. {% if theme_config('breadcrumb-enabled') %}
  2.     {% block layout_breadcrumb_inner %}
  3.         {% if category %}
  4.             {% set breadcrumbCategories = sw_breadcrumb_full(category, context.context) %}
  5.             {% set categoryId = category.id %}
  6.             {# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
  7.             {% set breadcrumb = sw_breadcrumb(category) %}
  8.             {# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
  9.             {% set breadcrumbKeys = breadcrumb|keys %}
  10.             {# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
  11.             {% set breadcrumbTypes = sw_breadcrumb_build_types(breadcrumbCategories) %}
  12.             {% set position = 1 %}
  13.             {% if breadcrumbCategories|length > 0 %}
  14.                 <div class="breadcrumb-container">
  15.                     <nav aria-label="breadcrumb">
  16.                         {% block layout_breadcrumb_list %}
  17.                             <ol class="breadcrumb"
  18.                                 itemscope
  19.                                 itemtype="https://schema.org/BreadcrumbList">
  20.                                 <li class="breadcrumb-item"
  21.                                     itemprop="itemListElement"
  22.                                     itemscope
  23.                                     itemtype="https://schema.org/ListItem">
  24.                                     <a href="{{ path('frontend.home.page') }}"
  25.                                        class="breadcrumb-link"
  26.                                        title="{{ "LnbThemeDefault.breadcrumb.home.title"|trans }}"
  27.                                        itemprop="item">
  28.                                         <link itemprop="url"
  29.                                               href="{{ path('frontend.home.page') }}"/>
  30.                                         <span class="breadcrumb-title"
  31.                                               itemprop="name">{{ "LnbThemeDefault.breadcrumb.home.label"|trans }}</span>
  32.                                     </a>
  33.                                     <meta itemprop="position" content="{{ position }}"/>
  34.                                 </li>
  35.                                 {% for breadcrumbCategory in breadcrumbCategories %}
  36.                                     {% set key = breadcrumbCategory.id %}
  37.                                     {% set name = breadcrumbCategory.translated.name %}
  38.                                     {% block layout_breadcrumb_list_item %}
  39.                                         {% if breadcrumbCategory.type !== 'folder' %}
  40.                                             {% set position = position + 1 %}
  41.                                             <li class="breadcrumb-item"
  42.                                                 {% if key is same as(categoryId) %}aria-current="page"{% endif %}
  43.                                                 itemprop="itemListElement"
  44.                                                 itemscope
  45.                                                 itemtype="https://schema.org/ListItem">
  46.                                                 <a href="{{ category_url(breadcrumbCategory) }}"
  47.                                                    class="breadcrumb-link {% if key is same as(categoryId) and product.name == undefined %} is-active{% endif %}"
  48.                                                    title="{{ name }}"
  49.                                                    {% if category_linknewtab(breadcrumbCategory) %}target="_blank"{% endif %}
  50.                                                    itemprop="item">
  51.                                                     <link itemprop="url"
  52.                                                           href="{{ category_url(breadcrumbCategory) }}"/>
  53.                                                     <span class="breadcrumb-title" itemprop="name">{{ name }}</span>
  54.                                                 </a>
  55.                                                 <meta itemprop="position" content="{{ position }}"/>
  56.                                             </li>
  57.                                         {% endif %}
  58.                                         {% if product.name %}
  59.                                             {% set position = position + 1 %}
  60.                                             <li class="breadcrumb-item"
  61.                                                 {% if key is same as(categoryId) %}aria-current="page"{% endif %}
  62.                                                 itemprop="itemListElement"
  63.                                                 itemscope
  64.                                                 itemtype="https://schema.org/ListItem">
  65.                                                 <span
  66.                                                         class="breadcrumb-link is-active "
  67.                                                         title="{{ product.translated.name }}"
  68.                                                         itemprop="item">
  69.                                                    <span class="breadcrumb-title"
  70.                                                          itemprop="name">{{ product.translated.name }}</span>
  71.                                                 </span>
  72.                                                 <meta itemprop="position" content="{{ position }}"/>
  73.                                             </li>
  74.                                         {% endif %}
  75.                                     {% endblock %}
  76.                                     {% block layout_breadcrumb_placeholder %}
  77.                                     {% endblock %}
  78.                                 {% endfor %}
  79.                             </ol>
  80.                         {% endblock %}
  81.                     </nav>
  82.                 </div>
  83.             {% endif %}
  84.         {% endif %}
  85.     {% endblock %}
  86. {% endif %}