portfolio iyo bissek

This commit is contained in:
Julie Blanc 2026-04-11 20:51:26 +02:00
parent fc85403e3a
commit 044ce3f76b
147 changed files with 218 additions and 38 deletions

View file

@ -54,3 +54,7 @@ fields:
"small": Petite
"medium": Moyenne
"big": Grande
classes:
label: Classes CSS
type: tags
icon: code

View file

@ -72,6 +72,21 @@ columns:
fieldsets:
- break
- blank
avant_titre:
label: "Avant le titre"
type: object
fields:
image:
label: Image
type: files
multiple: false
caption:
label: Légende
type: text
doublepage:
label: Double page
type: toggle
default: false
portfolio:
label: Portfolio
type: structure

View file

@ -8,6 +8,7 @@ $src = $block->image()->toFile()->url();
$GLOBALS['figCount'] = ($GLOBALS['figCount'] ?? 0) + 1;
$figId = 'fig-' . Str::slug($block->parent()?->author() ?? '') . '-' . $GLOBALS['figCount'];
?>
<?php if ($src): ?>

View file

@ -35,6 +35,17 @@
<span class="nav-author"><?= $chapitre->author()->html()->smartypants() ?></span>
<span class="nav-title"><?= $chapitre->title()->html()->smartypants() ?></span>
<!-- Image avant le titre -->
<?php $avantTitre = $chapitre->avant_titre()->toObject(); ?>
<?php if ($avantTitre->image()->isNotEmpty() && ($img = $avantTitre->image()->toFile())): ?>
<figure class="intro-portfolio <?= $avantTitre->doublepage()->toBool() ? 'double-page' : '' ?>">
<img src="<?= $img->url() ?>" alt="">
<?php if ($avantTitre->caption()->isNotEmpty()): ?>
<figcaption><?= $avantTitre->caption()->html() ?></figcaption>
<?php endif ?>
</figure>
<?php endif ?>
<!-- Entrées des chapitres -->
<div class="chapter-header">
@ -83,8 +94,9 @@
<div class="chapter-content">
<?php $GLOBALS['figCount'] = 0; ?>
<?php foreach ($chapitre->text()->toBlocks() as $block): ?>
<div id="<?= $block->id() ?>" class="block block-type-<?= $block->type() ?>">
<div id="<?= $block->id() ?>" class="block block-type-<?= $block->type() ?><?= $block->classes()->isNotEmpty() ? ' ' . implode(' ', $block->classes()->split(',')) : '' ?>">
<?= $block ?>
</div>
<?php endforeach ?>