{% sw_extends '@Storefront/storefront/layout/breadcrumb.html.twig' %}
{% 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="item">
<div itemprop="name">{{ name }}</div>
</div>
{% else %}
{% set breadcrumbUrl = category_url(breadcrumbCategory) %}
{% if 'marken' === name|lower %}
{% set breadcrumbUrl = path('frontend.cbax.manufacturer.index') %}
{% elseif 1 === loop.index0 and 'marken' === breadcrumbCategories|first.name|lower %}
{% set breadcrumbName = name|lower|replace({' ': '-'}) %}
{% set breadcrumbUrl = '/marken/' ~ breadcrumbName ~ '/' %}
{% endif %}
<a href="{{ breadcrumbUrl }}"
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="{{ breadcrumbUrl }}"
/>
<span class="breadcrumb-title" itemprop="name">{{ name }}</span>
</a>
{% endif %}
<meta itemprop="position" content="{{ loop.index }}"/>
</li>
{% endblock %}