📘
Magento 2 Megamenu
  • Overview
  • Installation
    • Setup via FTP or cPanel
  • Config and Usage
    • Install sample data
    • Module Configuration
    • Manage Megamenu
    • Create New Megamenu Profile
    • Configure menu item
    • Show menu on frontend Desktop
    • Show Menu On Frontend Mobile
    • How to use Magento 2 Pagebuilder
    • REST API
    • Graph Ql
  • FAQ
    • How to make desktop and mobile menu on same page?
    • How to use dynamic content tabs for sub menu items?
    • How to add a menu using Widget?
    • How to add products in submenu
    • How to show parent menu and sub menus in the same level
    • How to add label into menu items
    • How to add menu link to category and sub categories?
    • How to change default horizontal menu on header?
    • Problem when import larger categories into menu items?
    • How to show accordion menu on Desktop view?
  • Theme Compatible
    • Porto
    • Codazon Fastest Fashion
    • Ultimo
  • Video Tutorials
    • Video guides
Powered by GitBook
On this page

Was this helpful?

  1. FAQ

How to change default horizontal menu on header?

After setup the module on your site, you should create the menu profile which have Alias = “top-menu“, it will auto show on Header area of your site.

To change the default menu top to load other menu alias, ex: menu-top-default

You should edit the file “/app/code/Ves/Megamenu/view/frontend/layout/default.xml” or copy the file into your template folder “app/design/frontend/Theme Vendor/Theme Name/Ves_Megamenu/layout/“. Then change the code:

<argument name=”alias” xsi:type=”string”>top-menu</argument>

To:

<argument name=”alias” xsi:type=”string”>top-menu-default</argument>

Flush cache of your site to apply change.

The megamenu module also support widget block, widget shortcode to load menu profile on frontend. So you can load it in cms page, create widget instance to load it to any other position.

Notice:

The megamenu menu top block was reference to the block name “store.menu” – this is default block to load catalog navigation on header of default magento 2 theme. If your custom them are using other block, you also should change the layout xml file of the megamenu to reference to right block.

The default code in module layout xml file is:

<referenceBlock name="store.menu">
			<block class="Ves\Megamenu\Block\Menu" name="catalog.topnav" template="Ves_Megamenu::topmenu.phtml">
				<arguments>
					<argument name="alias" xsi:type="string">top-menu</argument>
				</arguments> 
			</block>
		</referenceBlock>
PreviousHow to add menu link to category and sub categories?NextProblem when import larger categories into menu items?

Last updated 3 years ago

Was this helpful?