Hello Everyone !
I am using Kirby CMS 5.1.4, I have just finished the installation and the panel is ready.
Now I would like to create a page builder. I believe it is better to use the Kirby block system than layouts, if I understand correctly.
So when I open a page and start building it, I want to be able to choose a layout (one column, two columns, 1/4+1/2+1/4, or 1/3+1/3+1/3, or 1/4+1/4+1/4+1/4—in short, all possible layout combinations).
Then I want to be able to add a title, text, button, image, quote, etc.
So I created a home.yml file, home.php, and a default page template that will also use this builder.
I created .yml files in my blueprints/blocks/… folder, for example : blueprints/blocks/titre.yml
I also created .php files in my snippets/blocks/… folder, for example : snippets/blocks/titre.php
However, when I create a page in my panel, nothing works. All the block elements are there but empty, and my page displays a blank page.
Thank you in advance for your help. I’m stuck and don’t know where to look. I’ve checked the semantics and everything seems OK, but I can’t find where the error is coming from
.
Have a nice day.
For example, this is my home.yml :
title: Accueil
preset: page
fields:
builder:
label: Contenu
type: blocks
fieldsets:
layout: layout
titre: titre
texte: texte
image: image
bouton: bouton
and my home.php :
<?php snippet('header') ?> <?php foreach ($page->builder()->toBlocks() as $block): ?><?= $block ?>
<?php endforeach ?>
<?php snippet('footer') ?>
+++

