index-main/site/templates/impact.php

55 lines
1.6 KiB
PHP
Raw Normal View History

2026-02-24 17:05:22 +01:00
<?php snippet('header') ?>
2026-02-24 17:42:51 +01:00
<main class="main__single">
2026-02-24 17:05:22 +01:00
<header class="page__header">
<p class="page__type">Impact</p>
<?php
$categories = $page->category()->split();
$category = $categories[0] ?? '';
?>
<?php if ($category): ?>
<p class="page__category"><?= esc($category) ?></p>
<?php endif ?>
<h2 class="page__title"><?= $page->title()->esc() ?></h2>
<?php if ($page->created()->isNotEmpty()): ?>
<time class="date" datetime="<?= $page->created()->toDate('yyyy-MM-dd') ?>"><?= $page->created()->toDate('d MMMM yyyy', 'fr_FR') ?></time>
<?php endif ?>
<?php if ($page->chapo()->isNotEmpty()): ?>
<p class="page__description"><?= $page->chapo()->inline() ?></p>
<?php endif ?>
2026-02-24 17:42:51 +01:00
<?php if ($cover = $page->cover()->toFile()): ?>
<figure class="page__cover">
<?php snippet('picture', ['file' => $cover]) ?>
</figure>
<?php endif ?>
2026-02-24 17:05:22 +01:00
</header>
<div class="page__content">
2026-02-24 17:42:51 +01:00
2026-02-24 17:05:22 +01:00
<?php if ($page->body()->isNotEmpty()): ?>
<?= $page->body()->toBlocks() ?>
<?php endif ?>
<?php $investigations = $page->linkedInvestigations()->toPages() ?>
<?php if ($investigations->isNotEmpty()): ?>
<aside class="impact__investigations">
<h3>Enquêtes liées</h3>
<ul class="investigations">
<?php foreach ($investigations as $investigation): ?>
<li><a href="<?= $investigation->url() ?>"><?= $investigation->title()->esc() ?></a></li>
<?php endforeach ?>
</ul>
</aside>
<?php endif ?>
</div>
</main>
<?php snippet('footer') ?>