0

I have created a custom module. Now I want to override layout of that module from my custom theme.

For that, I have created a theme and configure that theme to use intead of luma theme.

Now I have added layout in my custom theme like below to extend that layout and add some more blocks and remove some blocks.

app/design/frontend/vendor/themename/vendor_module/layout/layout.xml

But don't know somehow its always using custom module layout instead of extended layout in theme.

Is there anything I'm missing here? Please help for the same. Thanks in advance.

4
  • Other layout xml file working from your theme ? Feb 26, 2020 at 5:06
  • confirm the name of extension which you created properly? and layout file name code? Feb 26, 2020 at 5:30
  • @PankajPareek no layouts are working. But if I override phtml template then its working proper. Only layouts are not extending.
    – Deep Joshi
    Feb 26, 2020 at 5:31
  • @DhirenVasoya I have verified everything. Seems everything works fine. Even phtml files are overriding properly but only layouts are not extending.
    – Deep Joshi
    Feb 26, 2020 at 5:33

1 Answer 1

1

Seems like your theme created with Type = 1 (Virtual). So your layout file not overriding.

Check your database table "theme". If your theme type is set to 1(virtual) or 2(staging) set it to 1(physical).

You can check theme types in details here: Magento 2 - Theme Type 0:physical, 1:virtual, 2:staging. When to use?

Hope this helps!

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.