How to add Category Custom Layout Update XML file in Magento 2.3.4?

From Magento 2.3.4, Custom Layout Update Textarea removed from the admin panel category edit page, product edit page and cms edit page to remove the opportunity of Remote Code Execution (RCE). Replace Textarea with a selector.

Earlier you can add directly XML code snippet for the specific entity from the backend but from Magento 2.3.4 new feature was added. You need to create an XML file in your theme or module level and assign an XML file to the Custom Layout Update selector. Continue reading “How to add Category Custom Layout Update XML file in Magento 2.3.4?”

How to add wysiwyg in ui component form Magento 2?

You can add a WYSIWYG text field area using UI Component form in Magento 2 backend. With Wysiwyg, you can also add a page builder option to edit content using the page builder.

Use formElement as wysiwyg in XML file with field like <field name=”description” template=”ui/form/field” sortOrder=”10″ formElement=”wysiwyg”>

Add below XML code snippet to use Wysiwyg in custom form UI component,

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Rakesh Jesadiya
 */
-->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="general" sortOrder="5">
        <field name="content" sortOrder="10" 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>
            <settings>
                <label translate="true">Contents</label>
                <dataScope>content</dataScope>
            </settings>
            <formElements>
                <wysiwyg>
                    <settings>
                        <rows>5</rows>
                        <wysiwyg>true</wysiwyg>
                    </settings>
                </wysiwyg>
            </formElements>
        </field>
    </fieldset>
</form>

template=”ui/form/field” Default template used for Wysiwyg.
is_pagebuilder_enabled value is boolean if you set yes, page builder will be displayed instead of Wysiwyg.
toggle_button — Add toggle button with text Show/Hide editor button.
add_variables — Add Button with text insert variable.
add_widgets — Add Button with text Insert widget button
add_images — Add Button with text insert image button
<rows> indicates the no. of rows for the Wysiwyg.

How to Manage Checkbox field in ui component form Magento 2?

You can Manage/Add the checkbox component field in the admin panel Ui Component Form Magento. You can add a Checkbox type field with toggle, radio, and regular checkbox options.

Use formElement as a checkbox in the XML file with a field tag. <field name=”my_field” sortOrder=”10″ formElement=”checkbox”> Continue reading “How to Manage Checkbox field in ui component form Magento 2?”