Magento layout not working in custom theme
-
09-10-2020 - |
Question
I don't know if this question has answered before. I am creating a custom theme in magento 2.1. My parent theme is magento/blank.
I have copied layout and template files from module-theme\view\frontend
and pasted in app/design/frontend/vendor/themename/Magento_Theme/
My problem is that I lost the top links with welcome message after copying and pasting the layout folder. If i rename app/design/frontend/vendor/themename/Magento_Theme/layout
to any random name top links appears.
Can any one help me to sort it out? Thank you.
Solution
Here are few thing to do:
- Copy only file-names from parent theme. And copy only required files which need to edit. You only need to add updated code in these files.
- You add updated code in default.xml file. Only which you want to edit not all. ie if you to remove any element then you can mention like this
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
inside body tag
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange