investigation → add insert
All checks were successful
Deploy / Deploy to Production (push) Successful in 13s

This commit is contained in:
Julie Blanc 2026-02-19 15:15:47 +01:00
parent d51835a2c0
commit 65e8290edf
7 changed files with 98 additions and 3 deletions

View file

@ -0,0 +1,29 @@
name: Insert (conclusion, hightlight, notes)
icon: text
preview: fields
fields:
title:
label: Titre
type: text
width: 2/3
level:
label: Niveau
type: select
default: h3
width: 1/3
options:
h3: H3
h4: H4
h5: H5
text:
type: writer
size: huge
marks:
- bold
- italic
- underline
- link
- strike
nodes:
- bulletList
placeholder: Texte d'insert...

View file

@ -84,6 +84,7 @@ tabs:
- video
# - horizontal-gallery
- gallery
- insert
metadataTab:
label: Métadonnées
icon: table

View file

@ -0,0 +1,11 @@
<?php
/** @var \Kirby\Cms\Block $block */
?>
<div class="insert">
<div class="insert--inner">
<?php if ($block->title()->isNotEmpty()): ?>
<<?= $block->level()->or('h3') ?>><?= $block->title()->esc() ?></<?= $block->level()->or('h3') ?>>
<?php endif ?>
<?= $block->text() ?>
</div>
</div>

View file

@ -229,6 +229,9 @@
<?php elseif ($block->type() === 'horizontal-gallery'): ?>
<?php snippet('blocks/' . $block->type(), ['block' => $block]) ?>
<?php elseif ($block->type() === 'insert'): ?>
<?php snippet('blocks/insert', ['block' => $block]) ?>
<?php endif ?>
<?php endforeach ?>
</div>
@ -275,6 +278,8 @@
<?= $block->text() ?>
<?php elseif ($block->type() === 'heading'): ?>
<<?= $block->level()->or('h3') ?>><?= $block->text() ?></<?= $block->level()->or('h3') ?>>
<?php elseif ($block->type() === 'insert'): ?>
<?php snippet('blocks/insert', ['block' => $block]) ?>
<?php endif ?>
<?php endforeach ?>
</div>