• Hello,

    I am looking to embed some html with inline js code into a Guttenburg block. Maybe I have missed it but it is not clear to me that it will work in a block and if so, what I would need to do to get it to work.

    Can someone help clarify this for me?

    Many, many thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author David Artiss

    (@dartiss)

    Yep, it will work in a block just fine. Just type, for example, %CODE1% anywhere in a block and it will transformed, upon viewing into the appropriate embed code.

    Thread Starter sbigler

    (@sbigler)

    Hello David and thank you very much for your quick reply.

    I am still not getting my html with inline js to preview on my WP site.

    Here is what I did and maybe you can tell me what I am doing wrong:

    1. Added a new Custom HTML block on the page.
    2. Pasted embeddable html/javascript into this Custom HTML block.
    3. Added %CODE1% to this same block, at the top.

    After publishing and viewing, I only see %CODE1%. (I decided to use the same suffix you had in your example).

    Plugin Author David Artiss

    (@dartiss)

    What do you mean by “Pasted embeddable html/javascript into this Custom HTML block”? You should be adding any embed code into a custom field. You’ll need to make sure it’s named CODE1 too for the above example to work.

    Thread Starter sbigler

    (@sbigler)

    Okay, I see what you mean.

    However, it still did not work. It does not look like I can upload a screenshot so I will need to describe the latest:

    1. I activated custom fields and created one named CODE1, and for the value of CODE1 I pasted the custom html/imbedded javascript code. Then saved the custom field.

    2. Added a HTML block on the page and inside it I pasted {{CODE1}}. (In the plugin settings it is set up to use {{ }} as the identifiers)

    When I update and view the page I don’t see anything.

    Is there something I am still not doing right?

    Plugin Author David Artiss

    (@dartiss)

    That sounds correct. Can you give me the URL to the page where you’ve tried that?

    Thread Starter sbigler

    (@sbigler)

    Sure thing:

    https://calltoservice.org/seminars/

    Thank you.

    Plugin Author David Artiss

    (@dartiss)

    That was helpful. So, if I understand this correctly, you’ve embedded some logiforms.com JavaScript and, within that, you’re also trying to embed something?

    That’s what the output on that page looks like. If so, yeah, that isn’t going to work – I don’t allow embedding within embeds.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Will it allow embedded inline js code in a WP block?’ is closed to new replies.