I am wanting to make a custom block for the Editor plugin which will allow user to upload 1 audio file.
Following the Block extensions guide I am lost when it gets to writing the index.js for my audio-block plugin.
I am not sure how to fill the below in the index.js …
props:
methods:
template:
I thought I would be able to write something similar to the image-block as I am uploading a file, but don’t know what code to adapt. Any advice or documenatation out there?
There is no other documentation, I’m afraid and I have very little experience with those blocks. What I’d do for starters it try to copy the image block and just replace the accept property from image to audio.
Hey @matthack, I never ended up building an audio block for the editor plugin, but I did end up making a couple simple audio blocks for the builder plugin. Would they be helpful?
nope. But since you didn’t ask about it, there’s a chance you didn’t hear about the news.
The “blocks” core field (that will supersede the editor plugin), soon to be released with kirby 3.5, will be much easier to extend, and if I’m not mistaken it should then also be able to import “editor content”.
Don’t know if you’re informed about that progress, the team is currently at an alpha version, but it’s mature enough to try it out and play with it. https://github.com/getkirby/blocks/