Reputation: 27
I'm trying to move the navigation menu on a Magento 2 installation. I've created a child theme of the default blank theme and I want to move the navigation menu into the header of the site. At present I've accomplished it in CSS but I would rather move it in the code as it will be cleaner.
I've tried following other posts on this site along with the Magento Docs but all I seem to achieve is making the navigation menu disappear. Below is the code I'm using. It's probably something really small and stupid that I'm doing wrong but I was wondering if anyone out there could look at the code with a fresh set of eyes and spot the error of my ways ;)
Any help gratefully appreciated:
Code:
<move element="nav-sections" destination="page-header" after="block-search"/>
Thanks
Kev
Upvotes: 0
Views: 4124
Reputation: 1313
I'm not sure where you want to move it, the following moves it to the very top:
<move element="navigation.sections" destination="after.body.start"/>
In htdocs/vendor/magento/module-theme/view/frontend/layout/default.xml
you can finde some destinations that fit your needs.
Upvotes: 2