I’m wondering the best way to create the admin side for versatile layouts that the user can choose what to have and where depending on the content. I’m not sure of the best way to approach this so if anyone has managed something similar or knows a good way, I would appreciate some advice.
This is the example:
The builder plugin would be the way to go.
Oh wow! Thank you @texnixe I’m so glad I asked rather than trying to create something half arsed now Thank you so much and massive kudos to @timoetting the creator!!!
@texnixe & @timoetting - Just a quick cry for help. I can’t get the content to load in the webpage.
<?php snippet('head') ?>
<div class="container <?= $page->slug() ?>" >
<div class="module nopad">
<?php snippet('header') ?>
<h1><?= $page->title() ?></h1>
<?php foreach($page->builder()->toBuilderBlocks() as $block): ?>
<?php snippet('blocks/' . $block->_key(), array('data' => $block)) ?>
<?php endforeach ?>
<?php snippet('footer') ?>
It loads all the content apart from the content in the
Do the snippets exist in the right place and are their names the same as the ones you put into your blueprint?
I think you should check your blueprint .yml file for the name of the builder field. When I first used kirby-builder, I followed the example code and did not notice the field is named “mybuilder”, but the function in template looks for “builder” ($page->builder()->toBuilderBlocks()).
That did the trick @czJonny - Thank you and thank you @texnixe and @timoetting
I followed the example code and did not notice the field is named “mybuilder”, but the function in template looks for “builder” ($page-> builder() ->toBuilderBlocks()).
Yeah, that’s definitely confusing. I changed it in the ReadMe.