{% extends 'base.html.twig' %} {% block title %}{% if editMode|default(false) %}Édition : {% endif %}{{ metaTitle ?? title }}{% endblock %} {% block meta %} {% endblock %} {% block stylesheets %} {{ parent() }} {% endblock %} {% block body %}
{# Page Header - Editable in edit mode #}

{{ title }}

{# Intro Sections - Editable in edit mode #} {% if content.sections is defined and content.sections is not empty %}
{% for section in content.sections %}
{% if section.fields.content is defined %}
{{ section.fields.content|raw }}
{% endif %}
{% endfor %}
{% endif %} {# Child Pages Grid - Dynamic from DB, NOT editable #} {% if children is defined and children is not empty %}
{% for child in children %} {% set childLocale = app.request.locale %} {% set parentSlug = slug %} {% set childSlug = child.localizedSlug %} {% set childLink = childLocale == 'en' ? path('subpage_show_en', {parentSlug: parentSlug, slug: childSlug}) : path('subpage_show', {parentSlug: parentSlug, slug: childSlug}) %} {% set linkText = childLocale == 'en' ? 'Learn more' : 'En savoir plus' %} {# Render card component for each child page #} {% include 'components/_card.html.twig' with { 'image': child.featuredImage ?? null, 'title': child.localizedTitle, 'description': child.localizedDescription ?? null, 'link': childLink, 'linkText': linkText, 'modifierClass': 'card--project' } %} {% endfor %}
{% else %} {# Empty State - No child pages #}

{{ app.request.locale == 'en' ? 'No pages available at the moment' : 'Aucune page disponible pour le moment' }}

{% endif %}
{% endblock %}