I am adding WYSIWYG editor using the UI component in the magento2 custom module. But when I am adding the data by widget then it is not showing in a proper way. What is the issue?

*custom_hello_data.xml file in uicomponent.*

<field name="content">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">wysiwyg</item>
                    <item name="source" xsi:type="string">content</item>
                    <item name="label" xsi:type="string">Content</item>
                    <item name="template" xsi:type="string">ui/form/field</item>
                    <item name="wysiwyg" xsi:type="boolean">true</item>
                    <item name="dataScope" xsi:type="string">content</item>
                    <item name="sortOrder" xsi:type="number">50</item>
                    <item name="rows" xsi:type="number">8</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>

in frontend for print the data I am using template file

enter image description here

  • post your code... Commented Apr 20, 2020 at 11:59
  • In frontend layout I am using this to print the data of editor. and it is working fine but after adding the data from Widget then it show html content <?php echo $data['content']; ?> Commented Apr 21, 2020 at 6:52

1 Answer 1


can check following solution https://www.rakeshjesadiya.com/how-to-filter-static-block-content-in-template-file-using-magento-2/

need prepare cms-content, convert variables to text.

like for email template.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.