notsureabout Posted December 19, 2014 Share Posted December 19, 2014 (edited) 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.9Someone know how to make active state for current page in top menu 1.6.0.9?Thanks Edited December 20, 2014 by maicolstaip (see edit history) Link to comment Share on other sites More sharing options...
notsureabout Posted December 23, 2014 Author Share Posted December 23, 2014 (edited) 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.jsat the bottom, around line 123so 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 December 23, 2014 by maicolstaip (see edit history) Link to comment Share on other sites More sharing options...
maiolif Posted January 2, 2015 Share Posted January 2, 2015 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. 1 Link to comment Share on other sites More sharing options...
Stefand Posted February 2, 2015 Share Posted February 2, 2015 With 1.6.11 superfish is also changed. Your solution is not working anymore with 1.6. Link to comment Share on other sites More sharing options...
tspl Posted September 14, 2015 Share Posted September 14, 2015 Hi All, I have a one-level menu. Any one has solution for this issue "Adding 'active' state for current page in the top menu"? I am using 1.6.1.0. Thank you in advance! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now