Megamenu is a drop-down menu with multi-level expansions that lets you display your website’s full navigation into a single menu. A mega menu allows visitors to reach even the deepest sections of a website through the main menu.
Megamenu is one of the most beneficial aspects to improve user experience as Jakob Nielsen explains, “By helping users find more, they’ll help you sell more.”
In those cases, use the below solution to show the mega menu in Magento 2 store.
Solution for Navigation / Mega Menu is Missing When Varnish Cache is Activated in Magento 2:
Remove the TTL attribute (ttl=”3600″) from default.xml file located at vendor/magento/module-theme/view/frontend/layout.
<block class="Magento\Framework\View\Element\Template" name="store.menu" group="navigation-sections" template="Magento_Theme::html/container.phtml">
<argument name="title" translate="true" xsi:type="string">Menu</argument>
<block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="Magento_Theme::html/topmenu.phtml" ttl="3600" before="-"/>
Now check in the frontend, Megamenu is now displaying in your store!
That’s easy, right?
If you have any doubts regarding this post, just mention them in the Comments section below.
I would be happy to help.
Feel free to share the solution with Magento Community via social media.
Get Weekly Updates
Never miss Magento tips, tricks, tutorials, and news.
Thank you for subscribing.
Something went wrong.