Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Brett Fullam 119 posts 629 karma points
    Jun 02, 2017 @ 22:16
    Brett Fullam
    0

    Has anyone encountered problems using SVGs in an Umbraco site? I think I'm running into some sore of caching issue?

    OK ... So I can upload an SVG and see it's preview in the media section, but it's not rendering in the browser once the page is published?

    If I review the code for the published page the link is present in the code AND it's correct ... if I open that new link in a separate browser window the SVG renders without issue. What's even weirder is that after I open it up in a separate browser window the SVG appears in the published page layout. BUT then it disappears again ... 5-10 minutes later it's gone again.

    Is this some kind of weird caching issue?

    I think this is definitely over my head ... I'm running v7.6.2 ... any help-insight here would be appreciated.

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Jun 05, 2017 @ 14:46
    Alex Skrypnyk
    100

    Hi Brett

    It looks like an issue isn't related to Umbraco. How do you render SVG images on your site?

    Can you share code with us?

    Thanks,

    Alex

  • Brett Fullam 119 posts 629 karma points
    Jun 05, 2017 @ 15:24
    Brett Fullam
    0

    Hi Alex ... thanks for jumping in.

    For right now, to resolve this, there's nothing complex-dynamic going on ... I'm dropping it right into the layout treating the svg as an "image" like this:

    <img class="img-responsive" src="/media/1049/map-complete.svg" />
    

    However, when I drop it into an object tag it's good to go ... maybe it's tied to the whole security issue. I read somewhere that img tags with SVGs might be disabled.

    <object type="image/svg+xml" data="/media/1049/map-complete.svg" class="img-responsive"/></object>
    

    I'm using Google Chrome Version 58.0.3029.110 (64-bit). I've never encountered an issue like this before with SVG.

  • Brett Fullam 119 posts 629 karma points
    Jun 06, 2017 @ 15:16
    Brett Fullam
    0

    As soon as you said "how do you render SVG images" I remembered that there's more than one method to do so. Luckily this is an area of my client's site that will NOT be included in the CMS so I can do whatever I prefer to get the job done.

    switching from img tags to object tags did the trick, and I'm back in business.

    Appreciate your help Alex, thanks again.

  • Kong Yang 15 posts 103 karma points
    Mar 12, 2019 @ 22:04
    Kong Yang
    0

    Works great for me. Thank you.

Please Sign in or register to post replies

Write your reply to:

Draft