This commit is contained in:
parent
7dad587062
commit
c4724c8f8d
5 changed files with 54 additions and 2 deletions
22
site/snippets/blocks/gallery.php
Normal file
22
site/snippets/blocks/gallery.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
/** @var \Kirby\Cms\Block $block */
|
||||
$images = $block->images()->toFiles();
|
||||
?>
|
||||
|
||||
<div class="swiper">
|
||||
<div class="swiper-wrapper">
|
||||
<?php foreach ($images as $image): ?>
|
||||
<div class="swiper-slide">
|
||||
<figure>
|
||||
<img src="<?= $image->url() ?>" alt="<?= $image->alt()->esc() ?>">
|
||||
<?php if ($image->caption()->isNotEmpty()): ?>
|
||||
<figcaption><?= $image->caption()->html() ?></figcaption>
|
||||
<?php endif ?>
|
||||
</figure>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<div class="swiper-button-prev"></div>
|
||||
<div class="swiper-button-next"></div>
|
||||
<div class="swiper-pagination"></div>
|
||||
</div>
|
||||
|
|
@ -44,8 +44,8 @@
|
|||
<nav id="nav-highlight">
|
||||
<ul>
|
||||
<li><a href="/enquetes">Enquêtes</a></li>
|
||||
<li><a href="/investigation__content">Enquête</a></li>
|
||||
<li><a href="/impacts">Laboratoire</a></li>
|
||||
<li><a href="/impacts">Impacts</a></li>
|
||||
<li><a href="/laboratoire">Laboratoire</a></li>
|
||||
<li class="soutenir"><a targer="_blank" href="https://soutenir.index.ngo/">Soutenez-nous</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
|
|||
|
|
@ -262,6 +262,9 @@
|
|||
<?php elseif ($block->type() === 'video'): ?>
|
||||
<?php snippet('blocks/' . $block->type(), ['block' => $block]) ?>
|
||||
|
||||
<?php elseif ($block->type() === 'gallery'): ?>
|
||||
<?php snippet('blocks/gallery', ['block' => $block]) ?>
|
||||
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue