0

I've been trying to work out how to add a new wysiwyg block on my cms page form as I need 2 different blocks on each page.

I've been looking into the Cms module and I guess I need to extend view/adminhtml/ui_component/cms_block_form.xml in some way, but I'm not sure how, can someone point me in the right direction please?

  • I do not understand what are you trying to do. Wysiwyg is an abbreviate of type of editor. What in this context would be a Wysiwyg block? All content of cms pages is managed inside of this editor window and you can add inside any amount of cms block you might wish to. I do not follow really. – Bartosz Herba Nov 29 '17 at 8:26
  • Sorry for not being more clear, I want to add an exact copy of the content block in the backend cms form, but obviously with a different name – Tom Nov 29 '17 at 8:40
1

You must add a custom attributes to cms page See this tutorial:

https://www.magevision.com/blog/post/add-custom-field-to-cms-page-magento-2/

1

You will need to extend the cms_page_form.xml

like

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="content">
        <field name="custom_content">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string"/>
                    <item name="formElement" xsi:type="string">wysiwyg</item>
                    <item name="source" xsi:type="string">page</item>
                    <item name="wysiwyg" xsi:type="boolean">true</item>
                    <item name="dataScope" xsi:type="string">custom_content</item>
                    <item name="additionalClasses" xsi:type="string">admin__field-wide</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

This post will help you to achieve that.

Your Answer

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

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