I am using Kirby blocks for editing my blog posts. I would like to add to each that is being used in my block a data-id with the id of the image
The data-id-attribute should contain the image-id for static site generation in order to fetch the images automatically (with nuxt). My img tag should hence look more like this:
What’s the best approach to modify the block? Using a regular expression or is there a smarter way of modifying each element inside the “block” object ?
Holy moly, that was easy! Thank you so much! For reference, here’s what I did: I’ve created image.php in snippets/blocks/ and made sure that data-id attribute is rendered correctly: