Skip to content

Magento 2 How to override image.xml file in our custom extension

We want to override the below XML file in my custom extension.

vendor/magento/module-page-builder/view/adminhtml/pagebuilder/content_type/image.xml

We want to override this XML file because we want to allow another image extension type except for the default image type extension.

We add the below code in the Magento core image.xml file.

    <additional_data>
        <item name="uploaderConfig" xsi:type="array">
            <item name="allowedExtensions" xsi:type="string">jpg jpeg gif png xyz</item>
        </item>
    </additional_data>

So, When I add this xyz allowedExtensions type in the Magento core file It’s working when we upload xyz type image in Pagebuilder but when we override this XML file our custom extension It’s not working for me.

We tried the below way to override this xml file in our extension.

Vendor/Extension/view/adminhtml/pagebuilder/content_type/image.xml

    <additional_data>
        <item name="uploaderConfig" xsi:type="array">
            <item name="allowedExtensions" xsi:type="string">jpg jpeg gif png xyz</item>
        </item>
    </additional_data>