62 lines
No EOL
2.6 KiB
PHP
62 lines
No EOL
2.6 KiB
PHP
<?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>
|
|
<?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>
|
|
|
|
<?php snippet('calendar-strip') ?>
|
|
|
|
<?php if ($site->events()->isNotEmpty()): ?>
|
|
<?php
|
|
snippet('events-grid', ['title' => 'Prochainement', 'events' => $site->events()->toPages(), 'columns' => $site->events()->toPages()->count() === 1 ? 2 : $site->events()->toPages()->count()])
|
|
?>
|
|
<?php endif ?>
|
|
|
|
<?php snippet('newsletter-section') ?>
|
|
|
|
<?php snippet('callout') ?>
|
|
|
|
<?php snippet('footer') ?>
|