Support » Plugin: Block Lab » integrate a block via shortcode

  • Resolved alexwpec

    (@alexwpec)


    Hello,

    is it possible to integrate a block via shortcode?
    I often would like to integrate a block and pass it appropriate parameters without using the editor.

    Regards
    Alex

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

    (@ryankienstra)

    Hi @alexwpec,
    That’s interesting, but unfortunately I can’t think of a way to do that with Block Lab.

    sirius123

    (@sirius123)

    I successfully combined Block Lab with Global site variable plugin. Possibly if it is something as a wrapper that return just ready html?

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @sirius123,
    Ah, interesting. What’s the ‘Global site variable plugin’?

    sirius123

    (@sirius123)

    I mean https://wordpress.org/plugins/custom-global-variables/

    If content of the block lab block is presented in the editor dynamically, this content to be transferred to the shortcode, in which first parameter is the name of the block, and next parameters to be names of the block.

    or function that return/fill given global variable from the plugin from above with the result of the HTML generated by function that take as parameter array with block name and respective fields names and it values.

    Sample:
    If we have in the editor
    <!– wp:block-lab/mysection {“header”:”Do you want shortcode?”, “text”:”\u003cp\u003e some formated text here\u003c/p\u003e”} /–>

    to have similar API as wpBlockLabCallBack(“mysection”,….. ); which to be called in the relative shortcode function

    This is just a hints.

    • This reply was modified 2 months ago by sirius123.
    • This reply was modified 2 months ago by sirius123.
    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Ah, that’s interesting.

    Like you mentioned:

    to have similar API as wpBlockLabCallBack(“mysection”,….. ); which to be called in the relative shortcode function

    That could be a useful way to use blocks outside of only content areas.

    Unfortunately, we have a lot on our plate now 🙂 But that could be a useful feature.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.