vendor/shopware/storefront/Resources/views/storefront/layout/breadcrumb.html.twig line 1

Open in your IDE?
  1. {% block layout_breadcrumb_inner %}
  2.     {% if category %}
  3.         {% set breadcrumbCategories = sw_breadcrumb_full(category, context.context) %}
  4.         {% set categoryId = category.id %}
  5.         {% if feature('v6.5.0.0') %}
  6.             {% set breadcrumbKeys = breadcrumbCategories|keys %}
  7.         {% else %}
  8.             {% sw_silent_feature_call "v6.5.0.0" %}
  9.                 {# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
  10.                 {% set breadcrumb = sw_breadcrumb(category) %}
  11.                 {# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
  12.                 {% set breadcrumbKeys = breadcrumb|keys %}
  13.                 {# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
  14.                 {% set breadcrumbTypes = sw_breadcrumb_build_types(breadcrumbCategories) %}
  15.             {% endsw_silent_feature_call %}
  16.         {% endif %}
  17.         {% if breadcrumbCategories|length > 0 %}
  18.             <nav aria-label="breadcrumb">
  19.                 {% block layout_breadcrumb_list %}
  20.                     <ol class="breadcrumb"
  21.                         itemscope
  22.                         itemtype="https://schema.org/BreadcrumbList">
  23.                         {% for breadcrumbCategory in breadcrumbCategories %}
  24.                             {% set key = breadcrumbCategory.id %}
  25.                             {% set name = breadcrumbCategory.translated.name %}
  26.                             {% block layout_breadcrumb_list_item %}
  27.                                 <li class="breadcrumb-item"
  28.                                     {% if key is same as(categoryId) %}aria-current="page"{% endif %}
  29.                                     itemprop="itemListElement"
  30.                                     itemscope
  31.                                     itemtype="https://schema.org/ListItem">
  32.                                     {% if breadcrumbCategory.type == 'folder' %}
  33.                                         <div itemprop="item">
  34.                                             <div itemprop="name">{{ name }}</div>
  35.                                         </div>
  36.                                     {% else %}
  37.                                         <a href="{{ category_url(breadcrumbCategory) }}"
  38.                                            class="breadcrumb-link {% if key is same as(categoryId) %} is-active{% endif %}"
  39.                                            title="{{ name }}"
  40.                                            {% if category_linknewtab(breadcrumbCategory) %}target="_blank"{% endif %}
  41.                                            itemprop="item">
  42.                                             <link itemprop="url"
  43.                                                   href="{{ category_url(breadcrumbCategory) }}"/>
  44.                                             <span class="breadcrumb-title" itemprop="name">{{ name }}</span>
  45.                                         </a>
  46.                                     {% endif %}
  47.                                     <meta itemprop="position" content="{{ loop.index }}"/>
  48.                                 </li>
  49.                             {% endblock %}
  50.                             {% block layout_breadcrumb_placeholder %}
  51.                                 {% if key != breadcrumbKeys|last %}
  52.                                     <div class="breadcrumb-placeholder">
  53.                                         {% sw_icon 'arrow-medium-right' style { 'size': 'fluid', 'pack': 'solid'} %}
  54.                                     </div>
  55.                                 {% endif %}
  56.                             {% endblock %}
  57.                         {% endfor %}
  58.                     </ol>
  59.                 {% endblock %}
  60.             </nav>
  61.         {% endif %}
  62.     {% endif %}
  63. {% endblock %}