{% set sortedItems = [] %}
{% for child in sulu_navigation_root_tree(type, 3, true) %}
{% set icon = '' %}
{% set tmpUrl = sulu_content_path(child.url) %}
{% for item in child.excerpt.icon %}
{% if item.url is defined and item.url is not empty %}
{% set icon = item %}
{% endif %}
{% endfor %}
{% if theme is defined and theme is not empty %}
{% set url = tmpUrl ~ "?theme=" ~ theme ~ "&themeName=" ~ app.request.attributes.get('structure').document.title|url_encode %}
{% set sortedItems = sortedItems|merge([{
'title': child.title,
'url': url,
'icon': icon,
}]) %}
{% endif %}
{% endfor %}
<div class="navigation-count {{type}}">
<h2 class="fs50 lh36 fw400 ressources-title mb-20px">
{{ title is defined ? title : 'Ressources associées' }}
</h2>
<div class="dflex fwwrap">
{% for item in sortedItems %}
<a href="{{ item.url }}" class="mb-20px aside-menu-elem cwhite nodeco fw400 lh32 diflex aic br8 shadow-standard">
{% if item.icon %}
<img src="{{ item.icon.formats['300x'] }}" alt="" width={{item.icon.fileVersion.properties.width}} height={{item.icon.fileVersion.properties.height}} loading="lazy">
{% endif %}
<span>{{ item.title }}</span>
</a>
{% endfor %}
{% if withKiosque is defined and withKiosque %}
<a href="https://kiosque.pqn-a.fr/inscription" class="mb-20px aside-menu-elem cwhite nodeco fw400 lh32 diflex aic br8 shadow-standard">{{ source('svg/newsletter-logo.html.twig') }}<span>Abonnez-vous à la lettre d'information</span>
</a>
{% endif %}
</div>
</div>