Clickable Parent Dropdown Menu.

Solved

Clickable Parent Dropdown Menu.

ARPRO
Explorer
65 2 8

Hello,

 

I would like to have the ''Water Fed Poles & Accessories'' / ''Traditional Window Cleaning'' and ''Support'' menu to go to the pages that they are assigned to after clicking them.

 

Also I would like to have the ''Water Fed Pole Accessories'' to be made so after clicking it goes to the assigned page.

 

I would like to have them clickable without any design changes (still ''lights up'' when hovering over / doesn't turn blue etc.)

 

Untitled-1.png

Webiste: www.arprosystems.com

 

Could someone please help me do this?

 

Thank you in advance.

AR PRO Systems
Accepted Solution (1)
topnewyork
Globetrotter
633 113 134

This is an accepted solution.

@ARPRO dont change the above/previous code and do the following, as you can see the line number in first image, is where you have to wrap the span under <a> tag for water fed poles & accessories to work.


image (1).png

For styling add this: class=" list-menu__item link link--text focus-inset"

image (2).png

 

If my reply is helpful, kindly click like and mark it as an accepted solution.

Thanks!

Need a Shopify developer?
Hire us at Top New York Web Design
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel

View solution in original post

Replies 12 (12)

topnewyork
Globetrotter
633 113 134

Hi @ARPRO ,

Use the instructions told in the attached image then let me know.

 

image.png

 

If my reply is helpful, kindly click like and mark it as an accepted solution.

Thanks!

Need a Shopify developer?
Hire us at Top New York Web Design
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel
ARPRO
Explorer
65 2 8

Hello,

Just wrote this code in the header-dropdown-menu.liquid.

684f7044447a45f42650ae5c49eb1855.png

 

Now I have the clickable menu items in purple, but I would like them to be exactly as before.

 

cdd94a7c617c144627949c5a66f55105.png

Also, the ''Water fed pole accessories'' that is under the ''water fed poles & accessories'' still isn't clickable.

 

Could you help a bit more please to turn the menu items into the design that they were before, and also turn the ''water fed pole accessories'' into the same clickable menu item?

AR PRO Systems
topnewyork
Globetrotter
633 113 134

This is an accepted solution.

@ARPRO dont change the above/previous code and do the following, as you can see the line number in first image, is where you have to wrap the span under <a> tag for water fed poles & accessories to work.


image (1).png

For styling add this: class=" list-menu__item link link--text focus-inset"

image (2).png

 

If my reply is helpful, kindly click like and mark it as an accepted solution.

Thanks!

Need a Shopify developer?
Hire us at Top New York Web Design
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel
ARPRO
Explorer
65 2 8

I have put in the codes that you have provided.

The purple color has been fixed, but still the design is not as before - the menu items are now constantly highlighted with an underline, but before they were highlighting and underlining only when hovering over.

15a4394be0b9585f8054ba019443f8c5.png

426121dd415c1d84943e9d3aebbcc146.png

9f9a318f8f73cbd495fd4612c9824829.png

 

Also the sub menu ''Water Fed Pole Accessories'' is going to the wrong link when clicked. It should go to https://arprosystems.com/collections/water-fed-pole-accessories

instead of https://arprosystems.com/collections/water-fed-poles-accessories

c906e507638e38eb17f8112227803deb.png

 

In the backend, I have setup the sub menu correctly...

 

Could these things be fixed too please?

AR PRO Systems
ARPRO
Explorer
65 2 8

Fixed the sub menu not going to the right link myself. Now I only need the design of the menu items to not be constantly highlighted/underlined.

AR PRO Systems
topnewyork
Globetrotter
633 113 134

Hi @ARPRO , 

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file
3. In theme.liquid, paste the below code before </head>

 

<style>
a#HeaderMenu-water-fed-poles-accessories, 
a#HeaderMenu-traditional-window-cleaning, 
a#HeaderMenu-support {
    text-decoration: none !important;
    color: #bbbbbb !important;
}

a#HeaderMenu-water-fed-poles-accessories:hover, 
a#HeaderMenu-traditional-window-cleaning:hover, 
a#HeaderMenu-support:hover {
    color: #ffffff !important;
}
</style>

 

If my reply is helpful, kindly click like and mark it as an accepted solution.

Thanks!

Need a Shopify developer?
Hire us at Top New York Web Design
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel
ARPRO
Explorer
65 2 8

Hello,

 

The only thing missing now is that the menu item doesn't stay highlighted with an underline when clicked on, like the other menu items.

 

Could that be fixed too, please?

AR PRO Systems
topnewyork
Globetrotter
633 113 134

Replace my previous css styling code with this and then tell me:

/* Default link styles */
a#HeaderMenu-water-fed-poles-accessories, 
a#HeaderMenu-traditional-window-cleaning, 
a#HeaderMenu-support {
    text-decoration: none !important;
    color: #bbbbbb !important;
}

/* Hover styles */
a#HeaderMenu-water-fed-poles-accessories:hover, 
a#HeaderMenu-traditional-window-cleaning:hover, 
a#HeaderMenu-support:hover {
    color: #ffffff !important;
}

/* Active link span styles */
a.header__active-menu-item span {
    color: white !important;
    text-decoration: underline !important;
    text-underline-offset: .3rem !important;
}


First replace previous css with the new one given above then hit save and check and if it doesn't work then add the below codes as instructed. 



topnewyork_0-1725523428043.png


document.addEventListener("DOMContentLoaded", function() {
    const currentUrl = window.location.href;
    if (currentUrl.includes("water-fed-poles-accessories")) {
        document.getElementById("HeaderMenu-water-fed-poles-accessories").classList.add("header__active-menu-item");
    } else if (currentUrl.includes("traditional-window-cleaning")) {
        document.getElementById("HeaderMenu-traditional-window-cleaning").classList.add("header__active-menu-item");
    } else if (currentUrl.includes("support")) {
        document.getElementById("HeaderMenu-support").classList.add("header__active-menu-item");
    }
});


After adding this JS code and the Css, I've given you in this reply. It should work. Please let me know.

Need a Shopify developer?
Hire us at Top New York Web Design
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel
ARPRO
Explorer
65 2 8

Hello,

 

It is underlined now, but not highlighted when clicked.

AR PRO Systems
topnewyork
Globetrotter
633 113 134

Check the below css:

/* Default link styles */
a#HeaderMenu-water-fed-poles-accessories, 
a#HeaderMenu-traditional-window-cleaning, 
a#HeaderMenu-support {
    text-decoration: none !important;
    color: #bbbbbb !important;
}

/* Hover styles */
a#HeaderMenu-water-fed-poles-accessories:hover, 
a#HeaderMenu-traditional-window-cleaning:hover, 
a#HeaderMenu-support:hover {
    color: #ffffff !important;
}

/* Active link styles */
a.header__active-menu-item {
    color: white !important;
    text-decoration: underline !important;
    text-underline-offset: .3rem !important;
}
Need a Shopify developer?
Hire us at Top New York Web Design
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel
ARPRO
Explorer
65 2 8

Didn't work. Still not highlighted. But I think it is still good enough.

 

Thank you for all the help these 2 days.

 

Really appreciate you!

5 Stars

AR PRO Systems
topnewyork
Globetrotter
633 113 134

Kindly hit the like and mark it as the accepted solution. Thanks!

Need a Shopify developer?
Hire us at Top New York Web Design
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel