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): ?>
<?php if ($category['title'] == $page->title()->value()): ?>
<?php foreach($category['texts'] as $article): ?>
<li
class="text"
>
<a href="<?= $article->url() ?>" class="text__title no-line">
<h4><?= $article->title() ?></h4>
</a>
<div class="text__infos">
<p>
<span class="light">par</span>
<a class="author" href="/auteurs/<?= Str::slug($article->author()->toUser()->name()) ?>"><?= $article->author()->toUser()->name() ?></a><br>
<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>