investigation-summary : rendu des layouts avec blocs
- Création des snippets de blocs (text, heading, image) - Implémentation du rendu des layouts avec colonnes - Structure en grille pour layouts multi-colonnes NOTE : Cette implémentation est à revoir selon la maquette finale. Le rendu actuel utilise une structure basique en attendant les spécifications de design. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4a18a61148
commit
d9409e689a
4 changed files with 22 additions and 1 deletions
4
site/snippets/blocks/heading.php
Normal file
4
site/snippets/blocks/heading.php
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
$level = $block->level()->or('h2');
|
||||
?>
|
||||
<<?= $level ?>><?= $block->text() ?></<?= $level ?>>
|
||||
8
site/snippets/blocks/image.php
Normal file
8
site/snippets/blocks/image.php
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?php if ($image = $block->image()->toFile()): ?>
|
||||
<figure>
|
||||
<img src="<?= $image->url() ?>" alt="<?= $block->alt()->or($image->alt()) ?>">
|
||||
<?php if ($block->caption()->isNotEmpty()): ?>
|
||||
<figcaption><?= $block->caption() ?></figcaption>
|
||||
<?php endif; ?>
|
||||
</figure>
|
||||
<?php endif; ?>
|
||||
1
site/snippets/blocks/text.php
Normal file
1
site/snippets/blocks/text.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?= $block->text() ?>
|
||||
|
|
@ -120,7 +120,15 @@
|
|||
<?php if ($page->body()->isNotEmpty()): ?>
|
||||
<div class="section__article" id="section__synthese">
|
||||
<h3 class="section__title">Synthèse</h3>
|
||||
<?= $page->body()->toLayouts() ?>
|
||||
<?php foreach ($page->body()->toLayouts() as $layout): ?>
|
||||
<div class="grid" data-columns="<?= $layout->columns()->count() ?>">
|
||||
<?php foreach ($layout->columns() as $column): ?>
|
||||
<div class="column" style="--columns: <?= $column->span() ?>">
|
||||
<?= $column->blocks() ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue