SVG Store Logo Support

5 месяцев назад
The topic of SVG images has been discussed in the forums before but only in the context of product, category or manufacturer images. I have not seen any discussion of the store logo supporting SVG. Many companies like using SVG so there is no loss of clarity. Just a nice crisp clean logo.

From what I understand this is how nop renders the images through the imageresizer and would destroy the svg file? Ok, I understand this. However, what about hard-coding the url in the Views\Shared\Components\Logo\Default.cshtml to bypass the rendering?

How to change this

@model LogoModel
<a href="@Url.RouteUrl("Homepage")">
    <img title="" alt="@Model.StoreName" src="@Model.LogoPath">
</a>

into this

@model LogoModel
<a href="@Url.RouteUrl("Homepage")">
    <img title="" alt="@Model.StoreName" src="https://www.domain.com/images/uploaded/logo.svg">
</a>

To be clear, my above example does not work and I think this is asp.net protection? The strange thing is, if I put the "img" tag outside the "a" tag, the svg is displayed. This alone proves the svg works.

Regards
5 месяцев назад
I solved it for anyone who wants to do this. You need to specify a width.

@model LogoModel
<a href="@Url.RouteUrl("Homepage")">
    <img style="width:314px;" title="" alt="@Model.StoreName" src="https://www.domain.com/images/uploaded/logo.svg">
</a>