{% set ancestors = taxon.ancestors|reverse %}

<nav aria-label="breadcrumb">
    <ol class="breadcrumb">
        <li class="breadcrumb-item">
            <a href="{{ path('sylius_shop_homepage') }}">{{ 'sylius.ui.home'|trans }}</a>
        </li>

        {% for ancestor in ancestors %}
            {% if ancestor.isRoot() %}
                <li class="breadcrumb-item">{{ ancestor.name }}</li>
            {% else %}
                <li class="breadcrumb-item">
                    <a href="{{ path('sylius_shop_product_index', {'slug': ancestor.slug, '_locale': ancestor.translation.locale}) }}">{{ ancestor.name }}</a>
                </li>
            {% endif %}
        {% endfor %}

        <li class="breadcrumb-item">{{ taxon.name }}</li>
    </ol>
</nav>
