investigation → add insert
All checks were successful
Deploy / Deploy to Production (push) Successful in 13s
All checks were successful
Deploy / Deploy to Production (push) Successful in 13s
This commit is contained in:
parent
d51835a2c0
commit
65e8290edf
7 changed files with 98 additions and 3 deletions
29
site/blueprints/blocks/insert.yml
Normal file
29
site/blueprints/blocks/insert.yml
Normal 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...
|
||||
|
|
@ -84,6 +84,7 @@ tabs:
|
|||
- video
|
||||
# - horizontal-gallery
|
||||
- gallery
|
||||
- insert
|
||||
metadataTab:
|
||||
label: Métadonnées
|
||||
icon: table
|
||||
|
|
|
|||
11
site/snippets/blocks/insert.php
Normal file
11
site/snippets/blocks/insert.php
Normal 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>
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue