ajout du champs blockBody dans le template. Avec possibilité de mettre des image. L'ancien champs s'affichera toujour si le nouveau est vide

This commit is contained in:
antonin gallon 2026-02-13 13:11:37 +01:00
parent bb5d12cb36
commit f792954e04
6 changed files with 17 additions and 5 deletions

View file

@ -36,6 +36,14 @@ article h3 {
margin-bottom: calc(1 * var(--unit--vertical)); margin-bottom: calc(1 * var(--unit--vertical));
} }
article li, article ol{
margin-left: var(--unit--horizontal);
}
article figure img{
max-width: 100%;
}
@media screen and (min-width: 640px) { @media screen and (min-width: 640px) {
article #main-content { article #main-content {
max-width: auto; max-width: auto;

View file

@ -6,7 +6,8 @@ h3,
h4, h4,
h5, h5,
p, p,
ul { ul,
figure {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }

View file

@ -28,7 +28,8 @@ h4 *,
h5, h5,
h5 *, h5 *,
p, p,
p *:not(strong) { p *:not(strong),
figcaption {
font-weight: var(--font-weight-light); font-weight: var(--font-weight-light);
line-height: 1; line-height: 1;
} }
@ -168,7 +169,7 @@ a:not(.no-underline) {
text-decoration-thickness: 0.5px; text-decoration-thickness: 0.5px;
} }
article p:not(:last-child) { article p:not(:last-child), article ul:not(:last-child), article figure:not(:last-child){
margin-bottom: var(--unit--vertical); margin-bottom: var(--unit--vertical);
} }

View file

@ -42,7 +42,7 @@ tabs:
isArchiveMode: false isArchiveMode: false
body: body:
extends: fields/body extends: fields/body
help: Anciens champs conservés pour archive (ne pas remplir pour les nouveaux articles) help: Anciens champs conservés pour archive (ne pas remplir pour les nouveaux articles). Ce champs ne sera utiliser en front que si le champs "corp" normal est vide.
width: 3/4 width: 3/4
when: when:
isHtmlMode: false isHtmlMode: false

View file

@ -32,6 +32,8 @@
<?php endif ?> <?php endif ?>
<?php if ($page->isHtmlMode()->isTrue()): ?> <?php if ($page->isHtmlMode()->isTrue()): ?>
<?= $page->htmlBody()->kt() ?> <?= $page->htmlBody()->kt() ?>
<?php elseif ($page->bodyBlocks()->isNotEmpty()): ?>
<?= $page->bodyBlocks()->toBlocks() ?>
<?php else: ?> <?php else: ?>
<?= $page->body() ?> <?= $page->body() ?>
<?php endif ?> <?php endif ?>