We have a custom theme with some layout / template overrides

Now we have installed a 3rd party module, which is overriding one of layout files in our custom theme. So, only module's override is being loaded

I suppose, we can deal with this, by defining that concrete layout override in a custom module (instead of the custom theme approach), and then define the module dependencies to load both layout overrides

Or is there a way to do that without the need of declaring a new module?


About RishabhRkRai answer...

Let's say our custom theme is placed in folder app/design/frontend/Sinapsis/projectname

We had this layout override there:


Now, we've installed a module which overrides that same layout file. The concrete module name is Df_Checkout, and problem is our layout override stopped working

I've tried, following the answer, moving our override to


but only module's layout keeps loading

  • You can just create your module layout file inside theme and set your old layout changes to your new module layout file. Sep 1, 2017 at 5:19
  • please note that if you changed your sequence you need to run bin/magento module:disable YOUR_MODULE, followed by bin/magento module:enable YOUR_MODULE to make sure Magento has updated the configuration load order (as seen in app/etc/config.php) Sep 5, 2017 at 21:33

3 Answers 3


In your custom theme, follow this to override the layout file


After doing this, remove the static files and flush the cache

  1. rm -rf pub/static/*
  2. php bin/magento setup:static-content:deploy
  3. php bin/magento cache:flush

There is an alternate way, which may works for you. You just need to create an custom module and inside module.xml add the dependency like

    <?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_Modulename" setup_version="2.1.7">
            <module name="ThirdParty_ModuleName"/>

Now you have to override the xml file as


Scope can be either frontend or adminhtml (for backend)

  • 1
    You should not remove pub/static or static-content to overriding xml files. You only need clean or flush cache for this task. For more details: magento.stackexchange.com/a/184927/35758 Sep 2, 2017 at 17:16
  • 1
    Mmm... so it is same concept as overriding Magento modules files, is it? I think this does not work for me. 3rd party module continues loading its layout Sep 4, 2017 at 13:58
  • @RaulSanchez I used this method to override 3rd party module and It's work for me. Sep 5, 2017 at 6:10
  • I am going to update the question, so it is more clear Sep 5, 2017 at 6:59
  • 1
    Am I the only one who got this working with app/design/frontend/Theme_Vendor/Theme_Name/VendorName_ModuleName/layout/file_to_override.xml instead of app/design/frontend/Theme_Vendor/Theme_Name/VendorName/ModuleName/layout/file_to_override.xml. It should be VendorName_ModuleName instead of VendorName/ModuleName
    – Akash K.
    Jan 12, 2018 at 13:36

As per Magento documentation you need to put the layout file under "layout/override/base". Try this example ( tested on Magento ver. 2.3.5)


will override



Please note that magento has 2 ways to customize layout.

Extend layout http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/layout-extend.html

Override layout http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/layout-override.html

Here are a few steps to make sure that your layout is extended correctly.

  1. move layout in your theme


  1. Check the layout and make sure that block names match.

  2. Check the code in your Block. There are cases when the template was updated directly in the block code. In that way you need to extend the Block.

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.