Replace Source of image-tag

Hello,

I’m not 100% sure if I’m correct, but I have 2 questions about the source of an image tag (image: …).

  1. If I’m using it and the source isn’t available, it renders me <img src="domain.tlp/filename.png" /> instead of my current side. Is it possible to prevent this?

  2. Is it in general possible to overwrite the image tag under certain conditions?
    Example:
    If I’m using the template portfolio.php it should take all images from content/hidden-portfolio instead of content/1-portfolio

Thanks and a good weekend

You can overwrite the existing image tag:

  • extract the existing tag from /kirby/extensions/tag.php
  • copy into a new file and save in /site/tags/image.php
  • modify as required