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.
-
Other layout xml file working from your theme ?Pankaj Pareek– Pankaj Pareek2020年02月26日 05:06:24 +00:00Commented Feb 26, 2020 at 5:06
-
confirm the name of extension which you created properly? and layout file name code?Dhiren Vasoya– Dhiren Vasoya2020年02月26日 05:30:20 +00:00Commented 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– Deep Joshi2020年02月26日 05:31:28 +00:00Commented 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– Deep Joshi2020年02月26日 05:33:26 +00:00Commented Feb 26, 2020 at 5:33
1 Answer 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!