1

I am using Third Party Module for Admin section which used UI component to display data.The file path is

Vendoname/Modulename/view/adminhtml/ui_component/news_data_listing.xml file

.I want to override that file in our Custom module and display some more columns.

I have used same path and just copy paste that file and make some changes but these changes are not getting reflecting.

in Our Moudle file path is:

Vendoname/Mymodule/view/adminhtml/ui_component/news_data_listing.xml 

What should Used to override the Extension file.If anyone have idea please share me.

1

In your UI listing file, you should add the custom columns under the columns node and add the same name as in the 3rd party module's 'columns' node (so when files are loaded, the content is merged under the same keys).

For example my Vendor/Module/view/adminhtml/ui_component/customer_listing.xml is adding the billing phone number column to the vendor/magento/module-customer/view/adminhtml/ui_component/customer_listing.xml:

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="customer_columns">
        <column name="billing_telephone" sortOrder="60">
            <settings>
                <filter>text</filter>
                <editor>
                    <editorType>text</editorType>
                    <validation>
                        <rule name="validate-telephone" xsi:type="boolean">true</rule>
                    </validation>
                </editor>
                <label translate="true">Phone</label>
            </settings>
        </column>
    </columns>
</listing>

and in order to ensure the proper module loading order position, in my module.xml file I have:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_Module">
        <sequence>
            <module name="Magento_Customer"/>
        </sequence>
    </module>
</config>
1
  • Thanks a lot. It also works for 3rd party module overriding. Just copy/paste the same folder path whatever we want to override (ui_component or templates or layout, etc.) and must be same file name.
    – Felix Htoo
    Oct 8 at 7:36

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.