Important

Okay
  Public Ticket #1433401
getting content from phtml
Closed

Comments

  •  2
    E-difference started the conversation

    Hello,

    Magento: 2.2.1
    Latest version of ves page builder

    i want to get a page builder -element- in my phtml by element-code. 

    Is that posible?

  •  1,319
    Land of replied

    Hello Mate,

    Have a nice day!

    If you want to generate a page builder profile or element profile in phtml file by element-code, please try to use the code as this:

    <?php
    $helper                  = $this->helper("Ves\PageBuilder\Helper\Data"); 
    $page_profile_shortcode = '{{widget type="Ves\PageBuilder\Block\Widget\Page" code="abc-page-alias"}}';
    $element_profile_shortcode = '{{widget type="Ves\PageBuilder\Block\Widget\Builder" code="abc-element-alias"}}';

    echo $helper->filter($page_profile_shortcode);//generate page builder profile
    echo $helper->filter($element_profile_shortcode);//generate element builder profile

    ?>

  •  2
    E-difference replied

    Thanks! it works.

  •  1,319
    Land of replied

    You are welcome!