portfolio iyo-bisseck

This commit is contained in:
Julie Blanc 2026-04-12 16:46:06 +02:00
parent e76d9ef0eb
commit 38c510c658
13 changed files with 73 additions and 115 deletions

View file

@ -94,9 +94,18 @@
<div class="chapter-content">
<?php $GLOBALS['figCount'] = 0; ?>
<?php $figCount = 0; $figTypes = ['image', 'imagefloat', 'gallery', 'fullpageimage', 'spreadimage']; ?>
<?php foreach ($chapitre->text()->toBlocks() as $block): ?>
<div id="<?= $block->id() ?>" class="block block-type-<?= $block->type() ?><?= $block->classes()->isNotEmpty() ? ' ' . implode(' ', $block->classes()->split(',')) : '' ?>">
<?php
$isFig = in_array($block->type(), $figTypes);
if ($isFig) {
$figCount++;
$blockId = 'fig-' . Str::slug($chapitre->author()) . '-' . $figCount;
} else {
$blockId = $block->id();
}
?>
<div id="<?= $blockId ?>" class="block block-type-<?= $block->type() ?><?= $block->classes()->isNotEmpty() ? ' ' . implode(' ', $block->classes()->split(',')) : '' ?>">
<?= $block ?>
</div>
<?php endforeach ?>