Hi there — I’m new to Kirby and just started to implement a custom block type following this tutorial.
My custom block features an upload field which allows to upload a bunch of images (pretty much like the original Gallery block).
In the block php I was able to access those images with: $block->myCustomImages()->images()->toFiles() (is that the correct way?)
However I also want to display a preview of my images in the backend itself (using index.js). I know I can access them with {{ content.myCustomImages }} — but how can I iterate through those images so I can display them as thumbnails?
Bonus points if they would be displayed like the original Gallery block preview
I thought I did use the correct value for myCustomImages but it turned out that in index.js everything has to be lowercased instead of camelCased? (I am using camelCase notation in the yml file — would that be considered as bad practice?)
No more errors for now but unfortunately still not the intended result. The panel now looks like this:
… on top the default gallery preview (the way I want it to be), below the one I tried to implement. Appreciate any help that leads me into the right direction
Any hints where to put these? It’s not mentioned in the tutorial linked above (I’m not using Vue). Adding it to index.js does not have any effect (or more likely: I am doing something wrong).
This article was exactly what I needed to get it work — beyond helpful! — thank you so much @texnixe I really appreciate your support! Sorry for being such a n00b