hero : refonte du mode event et custom
Mode event : lien vers un spectacle (pages field, multiple: false), affichage titre + auteurs + ticket/dates en front. Mode custom : heroTextLeft (blocks) à gauche, heroTextRight (writer) + heroLink à droite. Suppression heroLinkText. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8776c089e4
commit
8725c590b4
2 changed files with 51 additions and 39 deletions
|
|
@ -65,38 +65,37 @@ tabs:
|
|||
options:
|
||||
event: Événement
|
||||
custom: Personnalisé
|
||||
heroText:
|
||||
label: Text
|
||||
heroTextLeft:
|
||||
label: Texte gauche
|
||||
type: blocks
|
||||
when:
|
||||
heroMode: custom
|
||||
fieldsets:
|
||||
- hero-heading
|
||||
- hero-text
|
||||
heroLinkUrl:
|
||||
- width: 1/2
|
||||
fields:
|
||||
heroEvent:
|
||||
label: Spectacle
|
||||
type: pages
|
||||
multiple: false
|
||||
query: page('programme').grandChildren
|
||||
when:
|
||||
heroMode: event
|
||||
heroTextRight:
|
||||
label: Texte droite
|
||||
type: writer
|
||||
when:
|
||||
heroMode: custom
|
||||
heroLink:
|
||||
label: Lien
|
||||
type: link
|
||||
width: 1/2
|
||||
options:
|
||||
- url
|
||||
- page
|
||||
help: Optionnel. Laisser vide pour ne pas afficher de lien dans le hero.
|
||||
when:
|
||||
heroMode: custom
|
||||
heroLinkText:
|
||||
label: Texte du Lien
|
||||
type: text
|
||||
width: 1/2
|
||||
when:
|
||||
heroMode: custom
|
||||
- width: 1/2
|
||||
fields:
|
||||
heroEvent:
|
||||
label: Événement
|
||||
type: pages
|
||||
query: page('programme').grandChildren
|
||||
when:
|
||||
heroMode: event
|
||||
heroImage:
|
||||
label: Image
|
||||
type: files
|
||||
|
|
|
|||
|
|
@ -1,22 +1,14 @@
|
|||
<?php snippet('header') ?>
|
||||
<section class="hero">
|
||||
<?php if ($site->heroMode() == 'custom'): ?>
|
||||
<div class="hero__text">
|
||||
<div>
|
||||
<?= $site->heroText()->toBlocks() ?>
|
||||
</div>
|
||||
<?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 if ($site->heroLink()->isNotEmpty()): ?>
|
||||
<a href="<?= $site->heroLink()->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(),
|
||||
'file' => $site->heroImage()->toFiles()->first(),
|
||||
'class' => 'image-cover',
|
||||
'size' => 60
|
||||
]) ?>
|
||||
|
|
@ -24,23 +16,22 @@
|
|||
<?php snippet('picture', ['file' => $site->heroImage()->toFiles()->count() > 1 ? $site->heroImage()->toFiles()->nth(1) : $site->heroImage()->toFiles()->first(), 'lazy' => false, 'size' => 60]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero__text">
|
||||
<div class="hero__title">
|
||||
<?= $site->heroTextLeft()->toBlocks() ?>
|
||||
</div>
|
||||
<div class="hero__book">
|
||||
<?= $site->heroTextRight() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php $heroEvent = $site->heroEvent()->toPage(); ?>
|
||||
<div class="hero__text">
|
||||
<div>
|
||||
<h2>
|
||||
<?= $heroEvent->title() ?>
|
||||
</h2>
|
||||
<?= $heroEvent->chapo() ?>
|
||||
</div>
|
||||
<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(),
|
||||
'file' => $heroEvent->gallery()->toFiles()->first(),
|
||||
'class' => 'image-cover',
|
||||
'size' => 60
|
||||
]) ?>
|
||||
|
|
@ -48,6 +39,28 @@
|
|||
<?php snippet('picture', ['file' => $heroEvent->gallery()->toFiles()->count() > 1 ? $heroEvent->gallery()->toFiles()->nth(1) : $heroEvent->gallery()->toFiles()->first(), 'lazy' => false, 'size' => 60]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero__text">
|
||||
<div class="hero__title">
|
||||
<h2><?= $heroEvent->title() ?></h2>
|
||||
<h3><?= $heroEvent->authors() ?></h3>
|
||||
</div>
|
||||
<div class="hero__book">
|
||||
<?php $schedule = $heroEvent->schedule(); ?>
|
||||
<?php if ($schedule): ?>
|
||||
<?php
|
||||
if ($heroEvent->isMapadoEvent() == 'true') {
|
||||
$bookingUrl = $heroEvent->url();
|
||||
} elseif ($heroEvent->bookingUrl()->isNotEmpty()) {
|
||||
$bookingUrl = $heroEvent->bookingUrl()->url();
|
||||
} else {
|
||||
$bookingUrl = null;
|
||||
}
|
||||
?>
|
||||
<?php snippet('ticket', $bookingUrl ? ['link' => $bookingUrl] : []) ?>
|
||||
<span><?= $schedule ?></span>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue