I am trying to use an image which I placed in assets/images in a header.php snippet as a logo. So far, I have come up with a solution looking like this:
This works as long as I am using .png. It does not work with .svg although even the Kirby reference site for the asset() function uses svg as an example. What am I doing wrong?
There are a few syntax issues with your code, but apart from that, creating thumbnails of .svg files doesn’t work (and doesn’t make sense). It probably shouldn’t throw an error either, but just return the file as is, but that’s another issue.
Would you point those syntax mistakes? I am trying to learn php/kirby. I can make stuff work somehow but, quite obviously, the code isn’t very beautiful…
What confused me to no end is that in the reference, using asset() on an svg is the showcase example: https://getkirby.com/docs/reference/objects/asset Why would you want to do that if not creating a thumbnail from an svg?