rxdUser Posted February 11, 2015 Share Posted February 11, 2015 Hi 2 All, I have a store in prestashop 1.6.0.11.In my top menu I have ul and thier respective li.Now I want to add an Id to each li item.for example if the main li is cosmatics,then its respective li's should have id cosmatics-1,cosmatics-2 etc. How to do this,Kindly help me. regards; RXD USER Link to comment Share on other sites More sharing options...
NemoPS Posted February 11, 2015 Share Posted February 11, 2015 You need to edit the blocktopmenu.php file (or actually extend it, since you're using the latest version, see here: http://nemops.com/override-prestashop-modules-core/ )generateCategoriesMenu method, but you have to set the original to protected instead of private if you want to try overriding it Link to comment Share on other sites More sharing options...
rxdUser Posted February 11, 2015 Author Share Posted February 11, 2015 Thanks nemo1 for fast reply.I am new to prestashop.kindly show me where to change the blockTopmenu.php to get my desired result. regards; Link to comment Share on other sites More sharing options...
vekia Posted February 11, 2015 Share Posted February 11, 2015 you can do it with jquery $(document).ready(function(){ $('#block_top_menu li').each(function(index){ $(this).attr('class', 'menuItem_' + index); }); }); then each menu item will have own unique class :-) 1 Link to comment Share on other sites More sharing options...
rxdUser Posted February 11, 2015 Author Share Posted February 11, 2015 Thanks Vekia.Great.............................................................................................................finally its done after working on it for 2 days. Thanks again again ...........................................................................................................and again.Can't express my feelings. regards; Link to comment Share on other sites More sharing options...
valdeck Posted April 28, 2015 Share Posted April 28, 2015 you can do it with jquery $(document).ready(function(){ $('#block_top_menu li').each(function(index){ $(this).attr('class', 'menuItem_' + index); }); }); then each menu item will have own unique class :-) Hello, can you tell me where i have to put these lines and in which file? Thanks you Ps : Sorry for my english i'm french ;-) Link to comment Share on other sites More sharing options...
rxdUser Posted April 30, 2015 Author Share Posted April 30, 2015 Hi valdeck, You can add these line in " root folder/themes/yourtheme/js/modules/blocktopmenu/blocktopmenu.js" regards; Link to comment Share on other sites More sharing options...
valdeck Posted April 30, 2015 Share Posted April 30, 2015 Thanks a lot ;-) Link to comment Share on other sites More sharing options...
valdeck Posted April 30, 2015 Share Posted April 30, 2015 I have this to the last of the folder superfish-modified 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')); $(document).ready(function() { $('#block_top_menu li').each(function(index) { $(this).attr('class', 'menuItem_' + index); }); });}); But the it does not work??? Link to comment Share on other sites More sharing options...
rxdUser Posted May 6, 2015 Author Share Posted May 6, 2015 Hi Valdeck, You have add the jquery code in the blocktopmenu.js file. I have added path to file in the above post. Link to comment Share on other sites More sharing options...
valdeck Posted May 6, 2015 Share Posted May 6, 2015 Hi Valdeck, You have add the jquery code in the blocktopmenu.js file. I have added path to file in the above post. Hi rxdUser I do not have that file. I have in the blocktopmenu file : blocktopmenu.php blocktopmenu.tpl config.xml index.php logo.gif menutoplinks.class.php In blocktopmenu -> js : hoverIntent.js index.php superfish-modified.js So where is the file which contains blocktopmenu.js???? Thanks so much for your help. Link to comment Share on other sites More sharing options...
rxdUser Posted May 6, 2015 Author Share Posted May 6, 2015 Hi valdeck, You need to go to your theme folder,then into js folder,then into modules folder and then into blocktopmenu folder,then click on js folder and finally you will see the following files, 1 : blocktopmenu.js 2: hoverIntent.js 3: superfish-modified.js You have to implement the changes into block topmenu.js file Please leave a message in case of any issue? Link to comment Share on other sites More sharing options...
valdeck Posted May 7, 2015 Share Posted May 7, 2015 (edited) Hi valdeck, You need to go to your theme folder,then into js folder,then into modules folder and then into blocktopmenu folder,then click on js folder and finally you will see the following files, 1 : blocktopmenu.js 2: hoverIntent.js 3: superfish-modified.js You have to implement the changes into block topmenu.js file Please leave a message in case of any issue? Hi rxdUser, I have just superfish-modified.js in this file???? Is normale? Or i have a problem? For information Version de PrestaShop: 1.5.6.2 And Version : 1.7 for the module Edited May 7, 2015 by valdeck (see edit history) 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