The user can easily set attributes like the alt text, classes etc. via the block settings. So far, so good.
But I’d like to reference the alt text image metadata from a sidecar (.txt) file, based on a file template. How would I go about referencing this in the image snippet?
I see that the image id and guid is present in the block attribute data, can I go from there?
doesn’t work, because the id contains the page name (mypage/xyz.jpg). But if I pass just the filename (‘xyz.jpg’) a proper file object is returned. Is there a way to get just the file name without the page part?
Hm, I thought the image helper accepted the id, at least it does in the example in the docs, but maybe that doesn’t work if you use it on the current page. Shame. I’ll have to look what other options we have.