templates/utils/_sidebar.html.twig line 1

Open in your IDE?
  1. {% set lastArticles = sulu_article_load_recent(3) %}
  2. {% set items = [] %}
  3. {% for event in content.events_teaser %}
  4.     {% if event.startdate is defined %}
  5.         {% set items = items|merge([event]) %}
  6.     {% endif %}
  7. {% endfor %}
  8. {% if content.show_agenda is defined %}
  9.     {% if content.show_agenda == "oui" %}
  10.         {% set showAgenda = true %}
  11.     {% else %}
  12.         {% set showAgenda = false %}
  13.     {% endif %}
  14. {% else %}
  15.     {% set showAgenda = true %}
  16. {% endif %}
  17. {# 
  18. <div>
  19.     {% for article in lastArticles %}
  20.         <h2>{{ article.title }}</h2>  
  21.         <small>{{ article.created|date() }}</small> 
  22.         <hr>
  23.         <p>{{ article.content.content.text_article|raw }}</p>
  24.         <hr>
  25.         <a href="{{ sulu_content_path(article.content.content.routePath) }}">Voir l'article</a>
  26.     {% endfor %}
  27.     
  28. </div> #}
  29. <div class="content-actu sidebar">
  30.     <div class="title">
  31.         <h2>Actualités</h2>
  32.     </div>
  33.     <div class="teaser_actus">
  34.         {% for article in lastArticles %}
  35.             <article>
  36.                 <a class="img-actu" href="{{ sulu_content_path(article.content.content.routePath) }}">
  37.                     {% if article.content.content.banner is defined and article.content.content.banner is not empty %}
  38.                         <div class="image lazy" data-src="{{  article.content.content.banner[0].formats['400x'] }}"></div>
  39.                     {% endif %}
  40.                 </a>
  41.                 <div>
  42.                     <div class="date_actu">{{ article.created|date("d / m / Y") }}</div>
  43.                     <h3><a href="{{ sulu_content_path(article.content.content.routePath) }}">{{ article.title }}</a></h3>
  44.                     <button aria-label="more" class="btn btn-light"><a href="{{ sulu_content_path(article.content.content.routePath) }}">En savoir plus</a></button>
  45.                 </div>
  46.             </article>
  47.         {% endfor %}
  48.     </div>
  49. </div>