Copied to clipboard

Flag this post as spam?

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


  • Mads Vester 4 posts 74 karma points
    Aug 18, 2020 @ 18:39
    Mads Vester
    0

    Lottie CDN

    Hi,

    I am trying to embed a Lottie animation on my Umbraco website. But embedding the

    <script> in the <head>section is causing a error. Probably because of the 2x@ in the url...</p>
    
    <script src="https://unpkg.com/@lottiefiles/lottie-interactivity@latest/dist/lottie-interactivity.min.js"></script>

    I am following this tutorial https://lottiefiles.com/interactivity for installation.

    What can I do to be able to install Lottie-animations ?

    Hope you can help me - since I am new to Umbraco :-)

  • Marc Goodson 2155 posts 14406 karma points MVP 9x c-trib
    Aug 18, 2020 @ 20:15
    Marc Goodson
    1

    Hi Mads

    I'm not sure about Lottie, but in your Umbraco views the @ symbol has a special meaning, it means 'write this variable out into the view'

    eg

    <h1>@Model.Name</h1>
    

    would write out the value of Model.Name into the H1 tag...

    ... but your lottie Url contains an @ symbol in it's own right, so I think here you probably need to 'escape' this, which you an do in Razor by having two @@ symbols next to each other eg:

    <script src="https://unpkg.com/@@lottiefiles/lottie-interactivity@@latest/dist/lottie-interactivity.min.js"></script>
    

    might work?

    regards

    Marc

  • Debasish Gracias 32 posts 163 karma points
    Jul 22, 2021 @ 19:49
    Debasish Gracias
    0

    Hi Mads,

    Try use &#64; instead of an actual @ to escape '@' symbol.

    Regards,

    Debasish

Please Sign in or register to post replies

Write your reply to:

Draft