nouveau-theatre-de-besancon/site/templates/home.php

67 lines
2.6 KiB
PHP
Raw Normal View History

2024-07-24 09:43:31 +02:00
<?php snippet('header') ?>
<section class="hero">
<?php if ($site->heroMode() == 'custom'): ?>
<div class="hero__text">
<?= $site->heroText()->toBlocks() ?>
<?php if ($site->heroLinkUrl()->isNotEmpty() == 'true'): ?>
<a class="hero__link h3" href="<?= $site->heroLinkUrl()->toUrl() ?>"><?php e($site->heroLinkText()->isNotEmpty() == 'true', $site->heroLinkText(), $site->heroLinkUrl()->toUrl()) ?></a>
2024-09-20 14:57:29 +02:00
<?php endif ?>
</div>
<div class="hero__image" style="--color: var(--color-season)">
<?php if ($site->heroLinkUrl()->isNotEmpty() == 'true'): ?>
<a href="<?= $site->heroLinkUrl()->toUrl() ?>" title="en savoir plus"></a>
<?php endif ?>
<div class="image-wrapper">
<?php if ($site->heroImage()->toFiles()->count() > 1): ?>
<?php snippet('picture', [
'file' => $site->heroImage()->toFiles()->first(),
'class' => 'image-cover',
'size' => 60
]) ?>
<?php endif ?>
<?php snippet('picture', ['file' => $site->heroImage()->toFiles()->count() > 1 ? $site->heroImage()->toFiles()->nth(1) : $site->heroImage()->toFiles()->first(), 'lazy' => false, 'size' => 60]) ?>
</div>
</div>
<?php else: ?>
<?php $heroEvent = $site->heroEvent()->toPage(); ?>
<div class="hero__text">
<h2>
<?= $heroEvent->title() ?>
</h2>
<?= $heroEvent->chapo() ?>
<a class="hero__link h3" href="<?= $heroEvent->url() ?>">Découvrir</a>
</div>
<div class="hero__image" style="--color: var(--color-season)">
<a href="<?= $heroEvent->url() ?>" title="en savoir plus"></a>
<div class="image-wrapper">
<?php if ($heroEvent->gallery()->toFiles()->count() > 1): ?>
<?php snippet('picture', [
'file' => $heroEvent->gallery()->toFiles()->first(),
'class' => 'image-cover',
'size' => 60
]) ?>
<?php endif ?>
<?php snippet('picture', ['file' => $heroEvent->gallery()->toFiles()->count() > 1 ? $heroEvent->gallery()->toFiles()->nth(1) : $heroEvent->gallery()->toFiles()->first(), 'lazy' => false, 'size' => 60]) ?>
</div>
</div>
<?php endif ?>
</section>
2024-08-28 14:41:30 +02:00
<?php snippet('calendar-strip') ?>
2024-07-30 19:03:01 +02:00
<?php
2024-09-13 16:36:32 +02:00
$orderedSeason = $kirby->collection('ordered-season');
$comingEvents = filterFutureEvents($orderedSeason);
?>
2024-07-30 19:03:01 +02:00
2024-09-13 16:36:32 +02:00
<?php
snippet('events-grid', ['title' => 'Prochainement', 'events' => $comingEvents->slice(0, 2), 'columns' => 2])
2024-07-30 19:03:01 +02:00
?>
<?php snippet('newsletter-section') ?>
2024-09-13 17:12:49 +02:00
<?php //snippet('events-grid', ['events' => $comingEvents->slice(2, 3)]) ?>
2024-07-31 11:20:08 +02:00
2024-09-13 16:00:15 +02:00
<?php snippet('callout') ?>
2024-07-31 12:09:03 +02:00
2024-07-24 09:43:31 +02:00
<?php snippet('footer') ?>