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.

Rakesh Donga
5,4442 gold badges26 silver badges58 bronze badges
asked Feb 26, 2020 at 5:02
4
  • Other layout xml file working from your theme ? Commented Feb 26, 2020 at 5:06
  • confirm the name of extension which you created properly? and layout file name code? Commented 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. Commented 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. Commented 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!

answered Feb 26, 2020 at 5:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.