Hello,
I’m trying to create a custom preview for a custom block. This is just a try. I’m totally new to plugins. I followed the custom preview guide but nothing happened in the panel.
/site/blueprints/blocks/element.yml :
name: Élément
icon: circle
tabs:
contenuTab:
fields:
contenu:
type: textarea
/site/plugins/element/index.php :
<?php
Kirby::plugin('lineaire/element-block', []);
/site/plugins/element/index.js :
panel.plugin("lineaire/element-block", {
blocks: {
button: `
<div class="element__content" @click='open'>
{{ content.contenu }}
</div>
`
}
});
/site/plugins/element/index.css :
.element__content {
border: 2px solid #000;
display: inline-flex;
border-radius: 3rem;
padding: .25rem 1.5rem;
cursor: pointer;
}
No result :