Jump to content

Adding 'active' state for current page in the top menu 1.6.9


Recommended Posts

Hello,

I was searching how to add active state in top menu 1.6.0.9.

I found this and it's really what I'd like to achieve

http://www.prestashop.com/forums/topic/220085-free-tutorial-adding-active-state-for-current-page-in-the-top-menu-all-pages/

but could not use in prestashop 1.6.0.9

Someone know how to make active state for current page in top menu 1.6.0.9?

Thanks

Edited by maicolstaip (see edit history)
Link to comment
Share on other sites

Ok, got it.
Here's how to get active state on current page Superfish v1.4.8 (prestashop 1.6.0.9)

Edit my_theme/js/modules/blocktopmenu/js/superfish-modified.js

at the bottom, around line 123
so that
 

jQuery(function(){
    jQuery('ul.sf-menu').superfish();
});

become
 

jQuery(function(){
    jQuery('ul.sf-menu').superfish()
$('.sfHover').addClass('sfHoverForce'); // will only target current links, since it's fired upod page load
function recursiveCheck(element)
    {
        if (!element.length)
            return;
        var the_ul = element.parent(); // unordered list parent
        if (the_ul.hasClass('sf-menu'))
            element.addClass('sfHoverForce'); //means it is another list item, add the class
        else recursiveCheck(the_ul.parent());
    }
    recursiveCheck($('.sfHoverForce'));
    });

Had to set
 

autoArrows    : false,

also to let the menu being homogeneous with my theme.

 

Thanks Nemo1 for pointing me to the right direction.

Hope this can help other people with the same problem.

Edited by maicolstaip (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Hi, while having Presta 1.6.0.9, my superfish version is 1.7.4, and it is completely different.

How to create a class specific for selected category/link.

Really I don't need superfish maybe also a simpler solution is ok. I have only one level menu.

  • Like 1
Link to comment
Share on other sites

  • 5 weeks later...
  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...