Hey,
I’ve been fiddling around a lot with the editor and keep running into issues unfortunately.
I just created another block plugin and it unfortunately breaks the whole editor. The usual editor area in the panel is simply replaced by a message saying ‘The field type “body” does not exist’
“Body” in this case refers to the underlying .yml file which looks like this.
(I know it’s that because if I change “body” to something else, the error message also changes)
fields:
methods:
type: text
width: 1/2
body:
type: editor
size: huge
However, I just cannot find the error in the block plugin I’ve created.
index.php
Kirby::plugin('smiddyburbon/card-block', [
'snippets' => [
'editor/card' => __DIR__ . '/snippets/card.php'
]
]);
index.js
editor.block("card", {
extends: "paragraph",
// will appear as title in the blocks dropdown
label: "Card",
// icon for the blocks dropdown
icon: "text",
});
snippets/card.php
<p class="card"><?= $content ?></p>
I’ve already tried replacing the name “card” with something else but that didn’t help either. It’s really weird since I’ve created 4 or 5 other plugins before and that worked okay actually.
Could you please take a look?
Thank you, much appreciated.
Best,
Dennis