I’d like to be able to use tags in a content text file so that I could add images the way that is needed nowadays, meaning it would be possible to offer different images for different screen sizes, etc.
I found this thread and tried to use the offered solution, but for some reason I can’t get it to work:
I just added that code into a single index.php file inside a folder in the plugins folder. Would that need something else besides that? (Now a simple test image tag I added to a text file won’t produce anything.)
Or are there any plugins that have already solved this thing? I haven’t found anything so far.
Ideally I’d like the tag to allow me to produce the kinds of things presented for example in this article:
the ‘image’ to anything else (I mean, like ‘pizza’ or whatever), it is neglected and my test image from my test text file appears again, thanks to the regular kirbytext tag. But, like I said, if I use this code, there will be no image at all (though the rest of the page appears normally).
The img tag in the example you posted above doesn’t have a src or srcset attribute, but only a data-srcset attribute. For this to work, you would therefore need a lazy-loading library.