Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 12d 16h 21m 29s
Claim 50% off
Awaiting an answer Templates

Menu item that target an anchor

Asked by Miguel 4 years ago Last activity 4 years ago

Hi there!
Is there a way for a menu item that target an anchor to be marked as an active menu?
Image
I´m using the Konstra template with joomla 4.0.4. This is my web and the 3rd item of the menu target an anchor in the home page, so the menu item that is marked as active is the "Home" item instead of the "Processes" item (as you can see in the image above) . Is there a way to show the same 3er item as active?

5 replies

Toufiq Senior Staff

Hi there,

Thanks for contacting us. Sorry for the inconvenience. Will you please provide me the Joomla administrator access to check the issue? I will check & get back to you soon. 

Note: Please share an screencast video about your issue

-Thanks

Paul Frankowski Senior Staff

Hi,

I can be wrong but it request using extra code customization,
only typical OnePage templates have this feature.

Pavel

Hi. In general, this work does bootstrap srollspy. But I could not apply it to Helix Menu. It works fine with the menu module, with HTML code, but not with Helix menu. It would be interesting to know why.

Miguel Asked this

Hi there. Here you can see the screen video, you can see how it is the "home" item marked as active when i choose the "processes" item, but when I choose an item that takes me to another page, it is that item the one marked as active.
You can find the administrator access in the hidden content!

Pavel
4 years ago · edited

Hi Miguel. I think this is outside the support of Joomshaper.

I got it working and here is the instruction:

Add two classes to the link in the menu item settings. Mandatory class nav-link and some kind of your own class for stylization, for example target-link.

Add following code to the custom.js file (read Helix documentation about this file)

For Helix Ultimate 1 based templates.

jQuery(function ($) {
    $('body').attr({
        'data-spy': 'scroll',
        'data-target': '.sp-megamenu-wrapper'
    });
     $('.sp-megamenu-parent').addClass('nav');
     $('.sp-menu-item').addClass('nav-item');
});

For Helix Ultimate 2 based templates.

jQuery(function ($) {
    $('body).attr({
        'data-bs-spy': 'scroll',
        'data-bs-target': '.sp-megamenu-wrapper'
    });
     $('.sp-megamenu-parent').addClass('nav');
     $('.sp-menu-item').addClass('nav-item');
});

Then use your own class to stylize active link state via css.
For exemple:

.target-link.active {
    color: red !important;
}
Log in to reply.