• Resolved Simon

    (@simonskaar)


    Hi there,

    Love the idea of this plugin but I use Flatsome with UX Builder so I suppose I have to use the shortcode. How should it be formatted with URL to my uploaded json-files?

    Also, if you could make a block for Flatsome (UX Builder), it would be awesome (still, shortcode is enough for me to be happy!)

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Johan Martin Aarstein

    (@johanaarstein)

    Hi,

    The format of the shortcode is:

    [am-lottieplayer src="/* Url to animation */" autoplay="true | false" controls="true | false" loop="true | false" objectFit="cover | contain | none"]

    The documentation is under Installation, but I guess it could be easier to find.

    Thanks for the tip with Flatsome! ??

    Thread Starter Simon

    (@simonskaar)

    Hi again,

    Thank you for clarifying. Still nothing happens on my website. I tried with full URL to .json file and .lottie-file.

    I tried this full:
    [am-lottieplayer src=”https://www.MYDOMAIN/wp-content/uploads/2023/01/am-lottieplayer-animation.lottie” autoplay=”true | false” controls=”true | false” loop=”true | false” objectFit=”cover | contain | none”]

    Am I writing it incorrectly or could it be a bug?

    Edit: The URL is complete, seems like this forum adds some symbols after the file extension for some reason

    • This reply was modified 2 years, 1 month ago by Simon.
    Thread Starter Simon

    (@simonskaar)

    This is the code I added: [am-lottieplayer src=”https://www.XXX.XXX/wp-content/uploads/2023/01/am-lottieplayer-animation.lottie” autoplay=”true” controls=”false” loop=”true” objectFit=”contain”]

    It displays in source code but nothing visual. The standard WP blocks works fine on blog posts so there must be something I did wrong with the shortcode.

    Plugin Author Johan Martin Aarstein

    (@johanaarstein)

    Yeah, you’re right! It turns out, when I made the plugins so that it only loads scripts when it is in use, I forgot to do the same for the shortcode. By bad! Try to update your plugin now, and see if it works.

    Thread Starter Simon

    (@simonskaar)

    Thank you for the quick update.

    It works now, thanks a lot!

    Excellent plugin thanks. Just seems to be an issue with loading the scripts if you use:

    echo do_shortcode(‘[am-lottieplayer…

    I’m wanting to use an ACF field to upload a lottie json file and output in a template. The shortcode loads the scripts if you add it in the post content but not if it’s applied as above.

    Plugin Author Johan Martin Aarstein

    (@johanaarstein)

    Hi, thanks for using the plugin!

    I see. This is an edge case, since most users wouldn’t want to load the scripts unless there’s a Lottie on the page. We might add an admin panel, where you choose how to load the scripts in the future.

    In the meantime – what if you added a Lottie as a placeholder animation? Wouldn’t that even make for better UI? ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Format of shortcode?’ is closed to new replies.