i want to implement the Kirby-builder plugin from the beginning before adding content to my website but I’m stuck while reading the readme.
So i added the fields section to my builder.yml blueprint file.
Now I’m at the point where the readme describes:
There are different ways to use the builder field inside a template. A clean approach for this is to use different snippets inside
site/snippets/sections/ that have the same file name like the field set names in the blueprint. In this case, we use the same snippet that we used for the preview inside the panel.
<?php # /site/templates/yourtemplate.php
foreach($page->mybuilder()->toBuilderBlocks() as $block):
snippet('blocks/' . $block->_key(), array('data' => $block));
So I create the folder sections inside site/snippets and then create the following php files inside there and paste the above code?:
quote.php, bodytext.php, events.php, calltoaction.php
Where goes the code, described last in the readme?
<php # /site/snippets/blocks/quote.php ?>
<?= $data->text() ?>
<?= $data->citation() ?>
Thanks so much for helping me out again, I’m reading through documentations again in the meantime…