• Hi,

    What is the best way to embed youtube videos in custom Lazy Blocks? I haven’t been able to get the embed shortcode working at all using PHP or handlebars.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Nikita

    (@nko)

    Hi.

    This one is working for me (screenshot clickable):

    Youtube embed with lazy blocks

    Regards, nK.

    Thread Starter mrlolly

    (@mrlolly)

    Thanks @nko this works!

    Do you know if it’s possible using handlebars?

    I’ve tried following the docs at https://lazyblocks.com/documentation/examples/shortcode-gutenberg/

    using:

    {{{do_shortcode 'embed' this}}}

    But nothing is showing up. I’m using handlebars in my existing templates so I’d prefer to keep using it instead of having to refactor everything into PHP.

    Thanks so much for the help you are a life saver! ??

    Plugin Author Nikita

    (@nko)

    Hi.

    The problem is that for some reason [embed] shortcode works only if it inserted in the post content or by using $pw_global variable.

    If you try to add it in your theme code using this code, it will not work as well:

    echo do_shortcode( '[embed]...[/embed]' );
    

    Regards, nK.

    Thread Starter mrlolly

    (@mrlolly)

    Thanks @nko,

    So is there no way to do this with handlebars then?

    If there is a way to do this with a handlebars template how would I do it?

    Plugin Author Nikita

    (@nko)

    Unfortunately, I don’t think it is possible without extra coding.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Embedding Youtube Videos in Blocks’ is closed to new replies.