add latest content at bottom
All checks were successful
Deploy / Deploy to Production (push) Successful in 12s
All checks were successful
Deploy / Deploy to Production (push) Successful in 12s
This commit is contained in:
parent
b436ea2770
commit
e36eae0b6f
2 changed files with 88 additions and 5 deletions
|
|
@ -33,13 +33,13 @@ $dateLocale = substr(is_array($locale) ? reset($locale) : $locale, 0, 5);
|
|||
</header>
|
||||
|
||||
|
||||
<div class="page__content">
|
||||
|
||||
<?php if ($page->body()->isNotEmpty()): ?>
|
||||
<div class="page__content">
|
||||
<?= $page->body()->toBlocks() ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<?php $investigations = $page->linkedInvestigations()->toPages() ?>
|
||||
<?php if ($investigations->isNotEmpty()): ?>
|
||||
|
|
@ -76,6 +76,43 @@ $dateLocale = substr(is_array($locale) ? reset($locale) : $locale, 0, 5);
|
|||
</aside>
|
||||
<?php endif ?>
|
||||
|
||||
<?php
|
||||
$latestNews = site()->find('news')
|
||||
->children()->listed()->not($page)
|
||||
->sortBy('created', 'desc')
|
||||
->limit(5);
|
||||
?>
|
||||
|
||||
<?php if ($latestNews->isNotEmpty()): ?>
|
||||
<aside class="page__aside" id="latest-news">
|
||||
<h3 class="aside__title">Voir aussi</h3>
|
||||
|
||||
<?php foreach ($latestNews as $newsItem): ?>
|
||||
<div class="card--block-small has-link">
|
||||
<div class="group-top">
|
||||
<p class="type"><?= t('news.type') ?></p>
|
||||
<?php if ($newsItem->category()->isNotEmpty()): ?>
|
||||
<p class="category"><?= $newsItem->category()->esc() ?></p>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<h4 class="title"><?= $newsItem->title()->esc() ?></h4>
|
||||
|
||||
<?php if ($newsItem->created()->isNotEmpty()): ?>
|
||||
<p class="date">
|
||||
<time datetime="<?= $newsItem->created()->toDate('yyyy-MM-dd') ?>"><?= $newsItem->created()->toDate('d MMMM yyyy', $dateLocale) ?></time>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
|
||||
<button class="btn--go-to">
|
||||
<a href="<?= $newsItem->url() ?>"><?= svg('assets/icons/arrow-left.svg') ?></a>
|
||||
</button>
|
||||
<a class="link-block" href="<?= $newsItem->url() ?>" aria-hidden="true"></a>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</aside>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
</main>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue