0

In Magento2 Enterprise Edition, in normal text field configuration, when configuring a form via XML, you just need to add "IS_PageBuilder_Enabled" to true in the parameter, and the PageBuilder will be launched when the form is rendered in the background, as follows:

<field name="content" formElement="wysiwyg" template="ui/form/field">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="source" xsi:type="string">page</item>
                <item name="wysiwygConfigData" xsi:type="array">
                    <item name="is_pagebuilder_enabled" xsi:type="boolean">false</item>
                    <item name="toggle_button" xsi:type="boolean">true</item>
                    <item name="height" xsi:type="string">200px</item>
                    <item name="add_variables" xsi:type="boolean">true</item>
                    <item name="add_widgets" xsi:type="boolean">true</item>
                    <item name="add_images" xsi:type="boolean">true</item>
                    <item name="add_directives" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
    </field>

The above code can render the PageBuilder Component successfully, but when we render the form in the Block using normal PHP code instead of the UI Component, we find the parameters: IS_PageBuilder_Enabled does not render PageBuilder component successfully. The code is as follows.

$fieldset->addField('post_content', 'editor', [
        'name' => 'post_content',
        'label' => __('Content'),
        'title' => __('Content'),
        'config' => $this->wysiwygConfig->getConfig([
            'toggle_button' => true,
            'is_pagebuilder_enabled' => true,
            'height' => '200px',
            'add_variables' => false,
            'add_widgets' => true,
            'add_directives' => true
        ])
    ]);

So my problem is how to render the PageBuilder component using PHP without using the XML configuration of the UI Component;

Thanks!

1
  • How to add pagebuilder any idea?
    – Liz Eipe C
    Sep 7 '21 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.