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

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