{# TODO stop using it with include, transform macro or twig function #}
{% if breadcrumb is defined and breadcrumb.items|length > 0 %}
{% set itemsCount = breadcrumb.items|length %}
<nav aria-label="breadcrumb"
class="{% if itemsCount > 1 %}nav-breadcrumb{% endif %} {{ breadcrumbNavClasses | default('') }}"
>
<ol class="breadcrumb {{ itemsCount > 1 ? 'nellapp-breadcrumb' : 'nellapp-breadcrumb-individual' }} {{ breadcrumbClasses | default('') }}">
{% set previousBtnItem = null %}
{% block root %}{% endblock %}
{% for item in breadcrumb.items %}
<li class="breadcrumb-item {% if not loop.first and loop.last %}active{% endif %}"
aria-current="page"
>
{% set itemTitle = item.title | trans( (item.transArgs | default({})) ) %}
{% if item.path is defined and item.path is not empty %}
{% set previousBtnItem = item %}
<a href="{{ item.path }}"
>
{{ itemTitle }}
</a>
{% else %}
{{ itemTitle }}
{% endif %}
</li>
{% endfor %}
</ol>
{% if itemsCount > 1 and previousBtnItem is defined and previousBtnItem is not empty %}
{% if previousBtnItem.path is defined and previousBtnItem.path is not empty %}
<a class="btn-breadcrumb-return"
href="{{ previousBtnItem.path }}"
>
<i class="far fa-arrow-left"></i>
{{ 'component.breadcrumb.button.previous.label'|trans([], 'NellappSDKBundle') }}
</a>
{% endif %}
{% endif %}
</nav>
{% endif %}