<nav class="breadcrumb pt8-pb8 dflex aic fwwrap mt-1em ml-1em">
{% set urlArray = content.routePath|split('/') %}
{% for element, i in urlArray %}
{% if loop.first %}
<div class="diblock home-icon">{{ source('svg/home-icon.html.twig') }}</div>
<a href="{{ sulu_content_root_path() }}" class="fw400 fs14 lh20 cblue p8">Accueil</a>
{% elseif loop.last %}
<div class="diblock chevron"><img src='/resources/img/chevron-right.svg' alt="" width="6" height="10"></div>
{% if content.title is defined and content.title is not empty %}
<div class="fw400 fs14 lh20 diblock cblue p8">{{ content.title }}</div>
{% endif %}
{% else %}
{# Ce break permet d'arrêter la boucle une fois la condition remplie, ici si la valeur de la boucle enfant a la même valeur que la boucle parente, alors on arrête #}
{% set break = false %}
{% set url = '' %}
{% for item, j in urlArray %}
{% if not break %}
{% set url = url ~ j ~ '/' %}
{% if loop.first %}
{% set url = '' %}
{% endif %}
{% if i == j %}
{% set break = true %}
{% endif %}
{% endif %}
{% endfor %}
{% set url = url|slice(0,-1) %}
<div class="diblock chevron"><img src='/resources/img/chevron-right.svg' alt="" width="6" height="10"></div>
<a href="{{ sulu_content_root_path() }}/{{ url }}" class="fw400 fs14 lh20 cblue p8">{{ titles[loop.index - 2] }}</a>
{% endif %}
{% endfor %}
</nav>