I am using Sitecore 9.1
with SXA 1.8
. I have uploaded SVG
file under media library. It is showing perfectly there but when I am trying to get it on the image component then it is showing as a plain image.
-
are you using scriban component to render svg image?– Praveen SoniCommented Feb 21, 2023 at 11:30
-
No @praveensoni– NishaCommented Feb 21, 2023 at 12:52
Add a comment
|
1 Answer
The classic SXA renderings will render an image with the help of the <img />
tag. Even if you choose an SVG
file it will still be rendered as <img />
with src
attribute referencing to your SVG
file, not as <svg />
tag.
If you would like to have the full control over your HTML markup you will need to create a new rendering. More technical details about HOW with EXAMPLES you can find in a similar discussion here.