Install plugin Kirby Builder

Hello,

I want to install my first plugin in my Kirby installation. I’m the beginner on Kirby CMS world and i’m lost.

I understood just copy my zip file in /starterkit-master/site/plugins/. Do I have to do anything else to see the plugin in action?

Thanks for your help.

Did you unpack the zip file and place the contents in site/plugins/kirby-builder?

Beyond that, you need to work through the rest of the guide by creating blue prints & builder blocks to work with.

Installing the plugin is no more than copying into the plugins folder.

To actually use it, you have to follow the instructions in the readme. I.e. add the field to your blueprint, add content, create the necessary snippets etc.

Probably not the ideal plugin to start with if you are really completely new to Kirby, because it requires that you know a bit of how Kirby works, with templates, snippets etc., but we are here to get you going.

Ok, that reassures me. I just have to immerse myself in the documentation. Thanks you for your replies.

Hi there,

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));

endforeach;

?>

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…

There is an error in the documentation, the code example

<?php # /site/templates/yourtemplate.php
foreach($page->mybuilder()->toBuilderBlocks() as $block):
  // snippets are called from `snippets/blocks` in this example
  snippet('blocks/' . $block->_key(), array('data' => $block));
endforeach;
?>

assumes that the snippets are located in site/snippets/blocks. That’s why the quote snippet is also in a blocks subfolder.

So the readme should read:

" A clean approach for this is to use different snippets inside site/snippets/blocks/ …"

But you can name that folder whatever you want, as long as you make sure to use the right path when you call the snippet function.