For the convenience of the editors, I’m overriding the Kirby image tag: Images in Text are automatically scaled down in 2 sizes, additional HTML for lazyloading is being generated, all is well.
Here’s the working approach:
- opening kirby/extensions/tags.php and copying the whole code under
//image tag
in a custom php file undersite/tags
. - building new image paths vars via
thumb()
handling of$file = $tag->file($url);
- shoving this into the image builder function which in turn returns a different
<img>
object.
Now obviously, this is not hacking core but feels pretty rough anyway – is there a less aggressive solution; say by overriding the image builder only?
Or am I missing another functionality and would be better off with a post/preprocessing plugin or some sort of meta-template?