📘
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
  • Step 1: Create Accordion Menu profile
  • Step 2: Add custom css code
  • Step 3: Add megamenu block on frontend layout or Widget Instance
  • Step 4: Flush cache of the site

Was this helpful?

  1. FAQ

How to show accordion menu on Desktop view?

Currently the mobile(hamburger) menu is displayed for devices which have screen width < 768 px.

PreviousProblem when import larger categories into menu items?NextPorto

Last updated 1 year ago

Was this helpful?

There steps to show accordion menu on Desktop view as bellow:

Demo accordion Desktop Menu:

Step 1: Create Accordion Menu profile

Add new megamenu profile as this:

Choose Desktop Template = Accordion Menu

Step 2: Add custom css code

Please add custom css code bellow on custom css file of current theme or you can add on admin > Stores > Configuration > Venustheme.com > Custom CSS on Frontend as screenshot:

// Custom css code
.ves-megamenu.ves-daccordion .navigation .nav-item a {
    display: block;
}
.ves-megamenu.ves-daccordion >.navigation .level0 {
    float: left!important;
    border-top: 1px solid #d1d1d1;
    border-top-color: rgba(0,0,0,.08);
}
.ves-megamenu.ves-daccordion>.navigation {
    border: 1px solid rgba(0,0,0,.15);
    float: left;
    background: #f8f8f8;
}
.ves-megamenu.ves-daccordion .navigation .opener {
    display: inline-block!important;
}
.ves-megamenu.ves-daccordion .opener:before {
    content: "\e61c";
}
.ves-megamenu.ves-daccordion .opener.item-active:before {
    content: "\e60f";
}
.ves-megamenu.ves-daccordion .navigation .opener {
    position: absolute!important;
    right: 0!important;
}

Step 3: Add megamenu block on frontend layout or Widget Instance

To show custom accordion menu on frontend, we can use layout xml to load the menu block as this:

<referenceContainer name="content">
    <block class="Ves\Megamenu\Block\Menu" name="catalog.accordionnav" ifconfig="vesmegamenu/general_settings/enabled" template="Ves_Megamenu::topmenu.phtml">
        <arguments>
            <argument name="alias" xsi:type="string">accordion-menu-profile</argument>
        </arguments>
    </block>
</referenceContainer>

Or use widget Instance

Go to admin > Content > Element > Widgets > Add new Widget as screenshots:

Step 4: Flush cache of the site

https://builder.landofcoder.com/demo-accordion-menu
Add new accordion menu profile
Open megamenu settings
Choose type ves megamenu: menu and design theme
Choose layout updates
Choose menu profile