- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've tried modifying and overriding the lib/web/mage/menu.js file whith my own file (which loads fine) in my custom theme with no success (using requirejs-config.js as stated in the documentation)...
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So, I managed to solve the problem but it's no easy task. I thought it would involve various javascript files but it's only about less/css. The doc mentions some menu.js file that is supposed to take care of the mobile menu switch but modifying it has no effect.
First step was to find the _navigation.less file from theme-frontend-blank and copy it in my main module (located in app/design/frontend) in web/css/source. I then switched to standard media query declarations to change the standard 768px break point :
The second step is getting the search button/input to switch to mobile at the given break point. The file doing this is the _module.less from Magento_CatalogSearch module. Same as before, simple meda queries set at 1130px do the job.
Speaking of the "search", the operation also involved duplicating the block search for design purposes. An operation easily done, without forgetting to duplicate the template form.mini.phtml and its js form-mini.js (and changing ids).
That's it !
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So, I managed to solve the problem but it's no easy task. I thought it would involve various javascript files but it's only about less/css. The doc mentions some menu.js file that is supposed to take care of the mobile menu switch but modifying it has no effect.
First step was to find the _navigation.less file from theme-frontend-blank and copy it in my main module (located in app/design/frontend) in web/css/source. I then switched to standard media query declarations to change the standard 768px break point :
The second step is getting the search button/input to switch to mobile at the given break point. The file doing this is the _module.less from Magento_CatalogSearch module. Same as before, simple meda queries set at 1130px do the job.
Speaking of the "search", the operation also involved duplicating the block search for design purposes. An operation easily done, without forgetting to duplicate the template form.mini.phtml and its js form-mini.js (and changing ids).
That's it !