1

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.

2
  • are you using scriban component to render svg image? Commented Feb 21, 2023 at 11:30
  • No @praveensoni
    – Nisha
    Commented Feb 21, 2023 at 12:52

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.