Magento 2 – How to Disable Page Builder for Specific Form Field

cms-pagesmagento2modulepage-builderuicomponent

I want to disable the page builder for specific fields in my custom module.
I want to show the default wysiwyg editor.
and all other page I need page builder with wysiwyg editor

Here is my UI component field

<field name="description" formElement="wysiwyg">
<argument name="data" xsi:type="array">
    <item name="config" xsi:type="array">
        <item name="source" xsi:type="string">BannerSlider</item>
    </item>
</argument>
<settings>
    <additionalClasses>
        <class name="admin__field-wide">true</class>
    </additionalClasses>
    <validation>
        <rule name="required-entry" xsi:type="boolean">false</rule>
    </validation>
    <label />
    <dataScope>description</dataScope>
</settings>
<formElements>
    <wysiwyg>
        <settings>
            <wysiwyg>true</wysiwyg>
        </settings>
    </wysiwyg>
</formElements>

Best Answer

You can disable the PageBuilder module for a specific field by adding the following entry to a field configuration in an XML configuration file:

<item name="wysiwygConfigData" xsi:type="array">
    <item name="is_pagebuilder_enabled" xsi:type="boolean">false</item>
</item>

Example The following example disables the PageBuilder editor for the content field.

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="content" sortOrder="10">
        <field name="content" formElement="wysiwyg">
            <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>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

You can read more about the Magento_PageBuilder module at https://developer.adobe.com/commerce/php/module-reference/module-page-builder/

Related Topic