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

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