{% if article.excerpt.categories is defined and article.excerpt.categories is not empty %} {% set categories = article.excerpt.categories %}{% endif %}{% if articleContentLinkedWith is defined and articleContentLinkedWith is not empty %} {% set articleContent = articleContentLinkedWith %}{% else %} {% if article.content.content is defined and article.content.content is not empty %} {% set articleContent = article.content.content %} {% endif %}{% endif %}{% if articleContent.header_img is defined and articleContent.header_img is not empty %} {% set img = articleContent.header_img %}{% endif %}{% if articleContent.chapo is defined and articleContent.chapo is not empty %} {% set chapo = articleContent.chapo %}{% endif %}{% if articleContent.date is defined and articleContent.date is not empty %} {% set date = articleContent.date %}{% endif %}{% if articleContent.time is defined and articleContent.time is not empty %} {% set time = articleContent.time %}{% endif %}{% if articleContent.price is defined and articleContent.price is not empty %} {% set price = articleContent.price %}{% endif %}{% if articleContent.event_type is defined and articleContent.event_type is not empty %} {% set event_type = articleContent.event_type %}{% endif %}{% if block.slider_mode is defined and block.slider_mode is not empty %} <li class="splide__slide"> <div class="preview-container agenda br8 dflex fdc"> {% else %} <div class="preview-container br8 dflex fdc agenda{% if i > 2 %} not-visible-mobile-article{% endif %}{% if i > 3 %} not-visible-tablette-article{% endif %}"> {% endif %} <div class="preview-header"> {% if img is defined and img is not empty %} {% include "blocks/previews/img/image.html.twig" %} {% else %} {% include "blocks/previews/img/default-image.html.twig" %} {% endif %} {% if date is defined and date is not empty %} {% set day = date|format_date(locale='fr')|split(' ')[0] %} {% set month = date|format_date(locale='fr')|split(' ')[1]|capitalize %} {% set year = date|format_date(locale='fr')|split(' ')[2] %} <div class="agenda-date dflex fdc aic br6 fs20 lh20 corange shadow-small"> <span>{{ day }}</span> <span>{{ month }}</span> <span class="fs12 lh16 fw400">{{ year }}</span> </div> {% endif %} {% if event_type is defined and event_type is not empty %} {% set text = "" %} {% if event_type == "presentiel" %} {% set text = "Présentiel" %} {% else %} {% set text = "Distanciel" %} {% endif %} <div class="agenda-type lh20 fs14 shadow-small">{{ text }}</div> {% endif %} <div class="background-color-orange"></div> </div> <div class="preview-content cwhite"> <a href="{{ sulu_content_path(article.routePath) }}" class="cblue nodeco dblock"> <div class="fw500 fs20 preview-h3 lh28 cwhite">{{ article.title }}</div> </a> {% include "blocks/previews-from-controller/blocks/categories.html.twig" %} {% include "blocks/previews-from-controller/blocks/place.html.twig" with { placeholder: articleContent } %} {% if date is defined and date is not empty %} <div class="date"> {% set dateArray = date|format_datetime('full', 'full', locale='fr')|split(' ') %} <img src="/resources/img/agenda/calendar-icon.svg" alt="calendar" width="16" height="16" loading="lazy"> {{ dateArray[0]|capitalize ~ " " ~ dateArray[1] ~ " " ~ dateArray[2]|capitalize ~ " " ~ dateArray[3] }} </div> {% endif %} <div> {% if time is defined and time is not empty %} <span class="time diblock"> <img src="/resources/img/agenda/clock-icon.svg" alt="Agenda" width="17" height="16" loading="lazy"> {{ time }} </span> {% endif %} {% if price is defined and price is not empty %} <span class="price"><img src="/resources/img/agenda/cash-icon.svg" alt="Prix" width="17" height="12" loading="lazy">{{ price }}€</span> {% endif %} </div> {% if chapo is defined and chapo is not empty %} <div class="lh24 preview-chapo {% if categories is defined and categories is not empty and categories|length == 2 %} threelines{% endif %}{% if categories is defined and categories is not empty and categories|length == 3 %} twolines{% endif %}"> {{ chapo|striptags|raw }} </div> {% if chapo|length > 200 %} <a href="{{ sulu_content_path(article.routePath) }}" class="cwhite">Lire la suite</a> {% endif %} {% endif %} </div> {% if block.slider_mode is defined and block.slider_mode is not empty %} </div> </li>{% else %} </div>{% endif %}