How can I maintain clickable links while using a mega menu in Dawn theme?

Solved

How can I maintain clickable links while using a mega menu in Dawn theme?

castlefurniture
Excursionist
15 0 3

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

https://2bb416.myshopify.com/

 

 

Accepted Solution (1)

DaviesYoung
Shopify Partner
11 4 6

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!

Davies&Young — Graphic Banners, Collection Thumbs and Social Media Promos for your Shopify Store.
+ Easy to Customize; Start for Free.

View solution in original post

Replies 3 (3)

DaviesYoung
Shopify Partner
11 4 6

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!

Davies&Young — Graphic Banners, Collection Thumbs and Social Media Promos for your Shopify Store.
+ Easy to Customize; Start for Free.
castlefurniture
Excursionist
15 0 3

Thank you this works!

StanleyTse
New Member
15 0 0

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!

StanleyTse_0-1718614005324.png