actuel-inactuel/site/templates/category.php

36 lines
1.5 KiB
PHP
Raw Normal View History

2024-04-06 10:08:45 +02:00
<?php snippet('header'); ?>
<main id="<?= $page->template() ?>">
<article>
<?php snippet('cover', slots: true) ?>
<?php slot('title') ?>
<?php endslot() ?>
2024-04-10 16:52:41 +02:00
<?php slot('text') ?>
2024-04-11 10:12:36 +02:00
<h2 class="main-title <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h2>
2024-04-10 16:52:41 +02:00
<ul class="texts">
<?php foreach($kirby->collection('categories') as $category): ?>
2024-12-01 13:57:24 +01:00
<?php if ($category->title() == $page->title()): ?>
2024-04-10 16:52:41 +02:00
<?php foreach($category['texts'] as $article): ?>
<li
class="text"
>
2024-11-26 13:21:42 +01:00
<a href="<?= $article->url() ?>" class="text__title no-underline">
2024-04-10 16:52:41 +02:00
<h4><?= $article->title() ?></h4>
</a>
<div class="text__infos">
<p>
<span class="light">par</span>
2024-10-16 08:53:53 +02:00
<a class="author" href="/auteurs/<?= Str::slug($article->author()->toPage()->title()) ?>"><?= $article->author()->toPage()->title() ?></a><br>
2024-04-10 16:52:41 +02:00
<span class="light">publié le </span><?= $article->published()->toDate('d/m/Y') ?><br>
<span class="light">dans</span> <a href="<?= $article->parent()->url() ?>"><?= $article->parent()->title() ?></a> / <a href="/categories/<?= $article->category() ?>"><?= $article->category() ?></a>
</p>
</div>
</li>
<?php endforeach ?>
<?php endif ?>
</ul>
2024-04-06 10:08:45 +02:00
<?php endforeach ?>
2024-04-10 16:52:41 +02:00
<?php endslot() ?>
<?php endsnippet() ?>
2024-04-06 10:08:45 +02:00
</article>
</main>