templates/Nordinfo/Main/parts/related_posts.html.twig line 1

Open in your IDE?
  1. <section class="sectionRelatedPosts">
  2.   {% if is_video_page is defined and is_video_page == true %}
  3.     <h2>À voir aussi</h2>
  4.   {% else %}
  5.     <h2>À lire aussi</h2>
  6.   {% endif %}
  7.   <ul class="gridRelatedPosts">
  8.     {% for post in related_posts %}
  9.       {% if post.slug is not null %}
  10.         <li>
  11.           <a href="{{ path('post_detail', {"slug": post.slug}) }}">
  12.             <div>
  13.               {% if (post.getIllustrationFilName() != null) %}
  14.                 {% set filename = post.getIllustrationFilName() %}
  15.                 {% if filename %}
  16.                   {% if filename matches '/images_defauts/' %}
  17.                     {% set assetPath = filename %}
  18.                   {% else %}
  19.                     {% set assetPath = 'upload/images/' ~ filename %}
  20.                   {% endif %}
  21.                   <img
  22.                     src="{{ asset(assetPath) | imagine_filter('thumb') }}"
  23.                     alt=""
  24.                   >
  25.                 {% endif %}
  26.               {% endif %}
  27.             </div>
  28.             <p><span>{{ post.title }}</span></p>
  29.           </a>
  30.         </li>
  31.       {% endif %}
  32.     {% endfor %}
  33.   </ul>
  34. </section>