templates/news/_news_lasted.html.twig line 1

Open in your IDE?
  1. {% set newsLasted = newsService.getListLasted %}
  2. {% if newsLasted %}
  3.     {% for news in newsLasted|default([]) %}
  4.         <div class="col-lg-4 col-md-6 mb-lg-5 mb-4">    
  5.           <div class="n-item d-flex flex-column h-100" data-aos='zoom-in'>
  6.             <div class="n-img mb-4">
  7.               <a href="{{ news.url }}">
  8.                 <img class="position-relative w-100" src="{{ news.media }}" alt="{{ news.title }}" 
  9.                     onerror="this.onerror=null;this.src='{{ asset('assets/images/no-img/news.jpg') }}';"/>
  10.               </a>
  11.             </div>
  12.             <div class="n-title mb-3">
  13.               <a href="{{ news.url }}">{{ news.title }}</a>
  14.             </div>
  15.             <div class="n-time mb-3">
  16.               <div class="n-icon"><i class="fa-solid fa-calendar-week"></i></div>
  17.               <div class="n-text">{{ news.createdDate|date('d M Y') }}</div>
  18.             </div>
  19.             <div class="n-text mb-3">
  20.               <div class="truncate-text">
  21.                 {{ news.description }}
  22.               </div>
  23.             </div>
  24.             <div class="n-link mt-auto">
  25.               <a href="{{ news.url }}">{% trans %}Lire l'article{% endtrans %}<i class="fa-solid fa-arrow-right"></i></a>
  26.             </div>
  27.           </div>
  28.         </div>
  29.     {% endfor %}
  30. {% endif %}