{% set lastArticles = sulu_article_load_recent(3) %}
{% set items = [] %}
{% for event in content.events_teaser %}
{% if event.startdate is defined %}
{% set items = items|merge([event]) %}
{% endif %}
{% endfor %}
{% if content.show_agenda is defined %}
{% if content.show_agenda == "oui" %}
{% set showAgenda = true %}
{% else %}
{% set showAgenda = false %}
{% endif %}
{% else %}
{% set showAgenda = true %}
{% endif %}
{#
<div>
{% for article in lastArticles %}
<h2>{{ article.title }}</h2>
<small>{{ article.created|date() }}</small>
<hr>
<p>{{ article.content.content.text_article|raw }}</p>
<hr>
<a href="{{ sulu_content_path(article.content.content.routePath) }}">Voir l'article</a>
{% endfor %}
</div> #}
<div class="content-actu sidebar">
<div class="title">
<h2>Actualités</h2>
</div>
<div class="teaser_actus">
{% for article in lastArticles %}
<article>
<a class="img-actu" href="{{ sulu_content_path(article.content.content.routePath) }}">
{% if article.content.content.banner is defined and article.content.content.banner is not empty %}
<div class="image lazy" data-src="{{ article.content.content.banner[0].formats['400x'] }}"></div>
{% endif %}
</a>
<div>
<div class="date_actu">{{ article.created|date("d / m / Y") }}</div>
<h3><a href="{{ sulu_content_path(article.content.content.routePath) }}">{{ article.title }}</a></h3>
<button aria-label="more" class="btn btn-light"><a href="{{ sulu_content_path(article.content.content.routePath) }}">En savoir plus</a></button>
</div>
</article>
{% endfor %}
</div>
</div>