Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Is there a way to retain the functionality of the menu link being an active clickable link while also being used as a mega menu? I'm using code to make the mega menu appear on hover.
This website shows how I'd like the navigation to function, they have the mega menu on hover and the category link remains clickable
https://www.blossomus.com/
Here is the link to my shopify store
Solved! Go to the solution
This is an accepted solution.
If I understand correctly you could try to add a link to the menu-items with a subnav.
- Snippets > header-mega-menu.liquid (l.19-25)
{%- assign parentlink = link.links[0] -%}
<a href="{{ parentlink.url }}" title="{{ parentlink.title }}">
<span
{%- if link.child_active %}
class="header__active-menu-item"
{% endif %}
>
{{- link.title | escape -}}
</span>
</a>
My two cents. Good luck!
This is an accepted solution.
If I understand correctly you could try to add a link to the menu-items with a subnav.
- Snippets > header-mega-menu.liquid (l.19-25)
{%- assign parentlink = link.links[0] -%}
<a href="{{ parentlink.url }}" title="{{ parentlink.title }}">
<span
{%- if link.child_active %}
class="header__active-menu-item"
{% endif %}
>
{{- link.title | escape -}}
</span>
</a>
My two cents. Good luck!
Thank you this works!
Hi Davies,
The codes are working but one more question from me.
The {%- assign parentlink = link.links[0] -%} code make the clickable parent menu link to the first url of the first child column.
However, I would like to know how to make the parent link linking to the parent URL , i.e. click on the "iPhone" to the "All iPhone" (green arrow), not to the "iPhone 15 (red arrow)? Thanks!
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025