{% sw_extends '@Storefront/storefront/layout/breadcrumb.html.twig' %}
{% block layout_breadcrumb_inner %}
{% if category %}
{% set breadcrumbCategories = sw_breadcrumb_full(category, context.context) %}
{% set categoryId = category.id %}
{# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
{% set breadcrumb = sw_breadcrumb(category) %}
{# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
{% set breadcrumbKeys = breadcrumb|keys %}
{# @deprecated tag:v6.5.0 - Use "sw_breadcrumb_full" directly. #}
{% set breadcrumbTypes = sw_breadcrumb_build_types(breadcrumbCategories) %}
{% if breadcrumbCategories|length > 0 %}
{% if controllerName == 'Product' %} <div class="container"> {% endif %}
<nav aria-label="breadcrumb">
{% block layout_breadcrumb_list %}
<ol class="breadcrumb"
itemscope
itemtype="https://schema.org/BreadcrumbList">
<li class="breadcrumb-item first-item">
<a href="{{ path('frontend.home.page') }}" itemprop="item" class="breadcrumb-link">
<link itemprop="url"
href="{{ path('frontend.home.page') }}"/>
{{ context.salesChannel.name|capitalize }}
</a>
</li>
{% for breadcrumbCategory in breadcrumbCategories %}
{% set key = breadcrumbCategory.id %}
{% set name = breadcrumbCategory.translated.name %}
{% block layout_breadcrumb_list_item %}
<li class="breadcrumb-item"
{% if key is same as(categoryId) %}aria-current="page"{% endif %}
itemprop="itemListElement"
itemscope
itemtype="https://schema.org/ListItem">
{% if breadcrumbCategory.type == 'folder' %}
<div itemprop="name" style="display: inline-block;">{{ name }}</div>
{% else %}
<a href="{{ category_url(breadcrumbCategory) }}"
class="breadcrumb-link {% if key is same as(categoryId) %} is-active{% endif %}"
title="{{ name }}"
{% if category_linknewtab(breadcrumbCategory) %}target="_blank"{% endif %}
itemprop="item">
<link itemprop="url"
href="{{ category_url(breadcrumbCategory) }}"/>
<span class="breadcrumb-title" itemprop="name">{{ name }}</span>
</a>
{% endif %}
<meta itemprop="position" content="{{ loop.index }}"/>
</li>
{% endblock %}
{% block layout_breadcrumb_placeholder %}
{% if key != breadcrumbKeys|last %}
<div class="breadcrumb-placeholder">
>
</div>
{% endif %}
{% endblock %}
{% endfor %}
{% if controllerName == 'Product' %}
<li class="breadcrumb-item"
itemprop="itemListElement"
itemscope
itemtype="https://schema.org/ListItem">
<span itemprop="name">{{ misc.translated.name }}</span>
</li>
{% endif %}
</ol>
{% endblock %}
</nav>
{% if controllerName == 'Product' %} </div> {% endif %}
{% endif %}
{% endif %}
{% if controllerName == 'Blog' %}
<nav aria-label="breadcrumb">
{% block layout_breadcrumb_list_blog %}
<ol class="breadcrumb"
itemscope
itemtype="https://schema.org/BreadcrumbList">
<li class="breadcrumb-item first-item">
<a href="{{ path('frontend.home.page') }}" itemprop="item" class="breadcrumb-link">
<link itemprop="url"
href="{{ path('frontend.home.page') }}"/>
{{ context.salesChannel.name|capitalize }}
</a>
</li>
<li class="breadcrumb-item">
<a href="/{{ controllerName }}/" itemprop="item" class="breadcrumb-link">
<link itemprop="url"
href="/{{ controllerName }}/"/>
{{ controllerName }}
</a>
</li>
{% if misc.blogCategories %}
{% if misc.blogCategories.elements %}
{% if misc.blogCategories.elements|first %}
{% set categoryElement = misc.blogCategories.elements|first %}
<li class="breadcrumb-item">
<a href="/{{ controllerName }}/{{ categoryElement.name }}/" itemprop="item" class="breadcrumb-link">
<link itemprop="url"
href="/{{ controllerName }}/{{ categoryElement.name }}/"/>
{{ categoryElement.name }}
</a>
</li>
{% endif %}
{% endif %}
{% endif %}
<li class="breadcrumb-item">
{% set currentPath = app.request.attributes.get('sw-original-request-uri') %}
<a href="{{ currentPath }}" itemprop="item" class="breadcrumb-link">
<link itemprop="url"
href="{{ currentPath }}"/>
{{ misc.title }}
</a>
</li>
</ol>
{% endblock %}
</nav>
{% endif %}
{% endblock %}