I have created a module and place it in a file I want to override


The original location is


I added backend_widget_grid.xml located in


And the content of the xml file is:

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceBlock name="widget.extended">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Vendor_Module::widget/grid/extended.phtml</argument>

I don't see my edits so can somebody tell me where is my mistake?

  • Is backend_widget_grid.xml a custom layout?
    – Haritha
    Mar 22, 2018 at 9:55

1 Answer 1


Override Magento\Backend\Block\Widget\Grid\Extended like this:


namespace Vendor\Module\Block\Adminhtml\Widget\Grid;

class Extended extends \Magento\Backend\Block\Widget\Grid\Extended
    protected $_template = 'Vendor_Module::widget/grid/extended.phtml';

and in di.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework/ObjectManager/etc/config.xsd">
    <preference for="Magento\Backend\Block\Widget\Grid\Extended" type="Vendor\Module\Block\Adminhtml\Widget\Grid\Extended" />
  • This looks like a way to override php not phtml. Is the first file you meantion named Extended.php in Vendor\Module\Block\Adminhtml\Widget\Grid\ and should di.xml be in etc/adminhtml/ ? Mar 22, 2018 at 11:00
  • 1
    yes, this is the way. You cannot override the template of this block inside a layout file because this block is not called directly in any layout .
    – George M
    Mar 22, 2018 at 12:24
  • Yes, i found the same way elsewhere so you are right, but I still can't see my edits Mar 22, 2018 at 12:45
  • Unless it's unavoidable please do not declare or override templates this way. It makes it very difficult for front-end developers to work with it, although at times the core hard codes templates this way (like this) :(
    – Ben Crook
    Mar 22, 2018 at 13:16
  • yes, i agree with you, @BenCrook. Probably, the best way to do this override is to override the template directly inside your custom admin theme folder, under Magento_Backend
    – George M
    Mar 22, 2018 at 14:11

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.