<section class="sectionRelatedPosts">
{% if is_video_page is defined and is_video_page == true %}
<h2>À voir aussi</h2>
{% else %}
<h2>À lire aussi</h2>
{% endif %}
<ul class="gridRelatedPosts">
{% for post in related_posts %}
{% if post.slug is not null %}
<li>
<a href="{{ path('post_detail', {"slug": post.slug}) }}">
<div>
{% if (post.getIllustrationFilName() != null) %}
{% set filename = post.getIllustrationFilName() %}
{% if filename %}
{% if filename matches '/images_defauts/' %}
{% set assetPath = filename %}
{% else %}
{% set assetPath = 'upload/images/' ~ filename %}
{% endif %}
<img
src="{{ asset(assetPath) | imagine_filter('thumb') }}"
alt=""
>
{% endif %}
{% endif %}
</div>
<p><span>{{ post.title }}</span></p>
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</section>