{% extends 'base.html.twig' %} {% block title %}{% if editMode|default(false) %}Édition : {% endif %}{{ metaTitle ?? title }}{% endblock %} {% block meta %} {% endblock %} {% block stylesheets %} {{ parent() }} {{ encore_entry_link_tags('actualite') }} {% endblock %} {% block javascripts %} {{ parent() }} {{ encore_entry_script_tags('actualite') }} {% endblock %} {% block body %}
{# Header: title + tag pills - title editable, tags are entity relations (managed via picker in a later issue) #} {% include 'components/_page_hero.html.twig' with { title: title, edit_mode: editMode|default(false), entity_id: entityId ?? 0, tags: tags|default([]), show_tags: true, tag_scope: 'actualite', title_class: 'page-hero__title--lato' } %} {% if (content.mainImage is defined and content.mainImage) or content.mainImageDark|default(false) or editMode|default(false) %}
{% if editMode|default(false) and not (content.mainImage|default(false) or content.mainImageDark|default(false)) %} + Ajouter l'image principale {% endif %} {% include 'components/_themed_img.html.twig' with {light: mainImagePath|default(''), dark: mainImageDarkPath|default(''), alt: title, class: 'actualite-page__hero-img'} only %}
{% endif %} {# Content blocks - rendered in stored order, dispatched by block.type. BlockListEditor.ts manages add/remove/reorder in edit mode: the wrapper below is always present in edit mode (even with zero blocks) so a new article can receive its first block via "Ajouter un bloc". #} {% if (content.blocks is defined and content.blocks is not empty) or editMode|default(false) %}
{% for block in content.blocks|default([]) %} {% if block.type == 'text' %} {% include 'components/_actualite-block-text.html.twig' with { block: block } %} {% elseif block.type == 'text-image-left' or block.type == 'text-image-right' %} {% include 'components/_actualite-block-text-image.html.twig' with { block: block, imagePosition: block.type == 'text-image-left' ? 'left' : 'right', mobileImagePosition: block.fields.mobileImagePosition|default('before') } %} {% endif %} {% endfor %}
{% endif %} {% if editMode|default(false) %} {# BlockListEditor.ts "Add block" control - offers the 3 block types, clones the matching hidden