I’m looking to extend the settings for the image block in the Kirby editor. The default image block has a modal with some options (alt text, link, css class). I’d like to add additional options like display size, and caption position.
What is the best way to do this? Create a new block that extends the image block functionality? Here is what a first attempt in that direction:
In addition to the documentation, these two files are key to setting up additional fields:
// js file that registers your vue component, it should extend the default image block,
// and add your custom fields
// the front end template to generate the custom html for this block,
// the template has access to the custom fields via $attrs->yourfieldname()->value()
I want to extend the image block by fields like image-size and image-alignment. I’ve tried the solution above but it doesn’t work.
I created an image-layout-block folder in site/plugins and created this files: