Is it possible to use twig without using the MB Builder to create blocks?

Support MB Blocks Is it possible to use twig without using the MB Builder to create blocks?Resolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #33065
    Kyle MeltonKyle Melton
    Participant

    Hi I was wondering if it was possible to create blocks utilizing twig without using the builder to create a block. If I were to add the code in the render section would twig be processed there?

    For example on this line in the code for a MB Block
    'render_code' => 'TWIG CODE HERE'

    Thank you!

    Kyle

    #33082
    Long NguyenLong Nguyen
    Moderator

    Hi Kyle,

    I've not used the Twig engine in a PHP file to create the block before but you can try to use the setting render_template to include the Twig file path.

    Refer to this article https://www.sitepoint.com/twig-popular-stand-alone-php-template-engine/
    and this documentation https://docs.metabox.io/extensions/mb-blocks/#render_template

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