I try to override my layout file from my theme in my child theme
I’m on magento 2.2.11 and I want to override my xml file from my theme with a child theme. I try to follow magento doc without success
I have :
app/design/frontend/Myvendor/mytheme/Myvendor_Header/layout/default.xml
And I want override him.
I try with this:
app/design/frontend/Myvendor/mytheme_child/Myvendor_Header/layout/override/theme/Myvendor/mytheme/default.xml
And my xml child doesn’t work, I don’t have error. It load only my parent xml.
My child theme is defined correctly because my .phtml files override parent file.
Do you have an solution for override my layout parent ?
3
Answers
I found a solution to my problem.
To start check if the theme is set in physical.
Go to your database -> table "theme" -> columns "type" must be 0
If you are testing multiple sites on one domain
For force a particular website go to index.php and add these lines :
Put the child layout in the child theme
app/design/frontend/Myvendor/mytheme_child/Myvendor_Header/layout/default.xml
Finally, launch command
Please try to add the layout.xml file in this path and after that run Magento Commands.
app/design/frontend/Myvendor/mytheme_child/Myvendor_Header/layout/default.xml
Thanks!!
Thanks a bunch Sebastien, spent almost 2 hours to fix this, you idea of changing type is really worked.