SVG Images
Is it possible to use SVG images in Sitefinity? I've changed the image upload settings to allow for SVG along with the mimetype in the advanced settings and made sure IIS supported the svg mimetype. I'm still not able to upload SVG images through the admin and I don't see them when I place them directly in the theme master files.
Hello Tommy,
The default Sitefinity implementation does not allow the upload of .svg files in the Images module. However you are able to do so if you choose to upload them in the Documents module. The file will not be threated as an image, but as a document, meaning it will not display, but rather start a download once clicked. The svg file will either download or display in a new tab depending on the browser's default behavior.
Sitefinity's documents do not have mime types and do not require you to register such neither in the backend, nor in your IIS. Mime types are important if you deal with Images and Videos, but not in the current case.
If you want to display the images, I can advise you store them in a content block that can be saved as shared content. The way to proceed with this is to include the xml directly on the page/template or using a content block and place the markup in the HTML window. Please view this video for further reference.
Regards,
Ivan D. Dimitrov
Telerik
Thanks for the detailed response Ivan!
Is there any plan to support SVG images in the future? High dpi screens are very common and using standard image formats isn't acceptable on those devices.
Hi Tommy,
Currently we have no plans of including the extention to the Images module. You do have a point however - the svg format is becoming more popular. Therefore I have logged a feature request on this manner. You can find its description in our Portal. Feel free to track its progress as well as vote for the request in order to increase its priority. We will do our best to include this functionality in our future releases.
Regards,
Ivan D. Dimitrov
Telerik
Its been 2 years since this thread was created SVGs are now used frequently and this REALLY needs to be implemented - when is it planned for?
We usually use svg images as well in our company now, as we have a very demanding CI/CD.
How does svg support look like today?
Is there any workaround that can be used until SF 10.0 is released?
It's not by any means a great solution, but I use SVG in Sitefinity as inline images. When dealing with something like a few icons that are going to be updated only in one spot it is not a major issue for me to upkeep, but to a typical content editor it is not going to be fun.
SVG really needs to be supported as a proper type with how widely used it is in the market.
I found you could upload them as the "document type" and reference them that way in a custom widget template view for widgets other than the default Image one. For example, you could create a custom Documents List view (Mvc/Views/DocumentsList/List.YourTemplateName.cshtml) and then when you drop the Documents List widget on the page, choose the svg images you want to display and select "Your template name" under the List settings tab > List template.