• Resolved dealenx

    (@dealenx)


    Hi,

    I want to develop a Lazy Block without adding by WordPress Admin. I have seen docs and I don’t understand examples there. I have success only with exported code from plugin, but i can’t put template path, for example:

    …/<my_theme>/functions.php:

    
    if ( function_exists( 'lazyblocks' ) ) :
    lazyblocks()->add_block( array(
    ....
     'code' => array(
           ...
                'frontend_html' => '/blocks/lazyblock-hello-world-block/block.php',
           ...
            ),

    `

    ideally I would split code into multiple files (frontend, editor, css and js) of the block.

    Thanks in advance!

    • This topic was modified 3 years, 1 month ago by dealenx.
Viewing 1 replies (of 1 total)
  • Plugin Author nK

    (@nko)

    Hey.

    The frontend_html attribute is used for the HTML string. You can’t just put a path here. There is no option to set custom template path, there is only option with automatically generated paths with theme templates https://lazyblocks.com/documentation/blocks-code/theme-template/

    Unfortunately, our plugin does not yet have advanced documentation for programmers, you will need to use the export block feature to understand how it should work in the code.

    Regards, nK.

Viewing 1 replies (of 1 total)
  • The topic ‘how to build programatically Lazy Blocks within theme’ is closed to new replies.