cedric_charles Posted March 21, 2016 Share Posted March 21, 2016 Hello, I would like to add a small icon to subcategories in PrestaShop submenu. For this (if you have another solution, I'm interested), I'll just target each item and add its icon in CSS. I would like to add a class like "cat-15" (15 is the id of the category) to "li". Unfortunately I can"t find how the menu items are created... Thank you in advance, Cédric Link to comment Share on other sites More sharing options...
presta.show Posted March 21, 2016 Share Posted March 21, 2016 Which menu do you mean? Submit a screenshot. Link to comment Share on other sites More sharing options...
cedric_charles Posted March 22, 2016 Author Share Posted March 22, 2016 Here is is ! It's the default navigation of Prestashop. I have a level 1 item "Mode grossesse" which is a category. On hover, you can see the sub categories. I would like to add an icon to the sub categories. https://space.zeo.net/g/4egtd/W64BRNGEVMDON3DWRMMILXVSE7STQTXD Thank you in advance, Cédric Link to comment Share on other sites More sharing options...
presta.show Posted March 22, 2016 Share Posted March 22, 2016 You can use css :before like this: .navigation_class ul li:before { content: url('../your_icon.png'); } Link to comment Share on other sites More sharing options...
cedric_charles Posted March 22, 2016 Author Share Posted March 22, 2016 Thank you Kalifsoup. But I need a different icon depending on the subcategory. So I need to add unique ID on each item to identify them and than add the icon with CSS depending on that ID... Link to comment Share on other sites More sharing options...
presta.show Posted March 23, 2016 Share Posted March 23, 2016 If it's default prestashop theme, you should look at file:/thmes/default-bootstrap/modules/blocktopmenu/blocktopmenu.tpl Link to comment Share on other sites More sharing options...
cedric_charles Posted March 23, 2016 Author Share Posted March 23, 2016 The problem is that in this .tpl, the sub categories items are create like that : <div id="block_top_menu" class="sf-contener"> <div class="cat-title">{l s="Menu" mod="blocktopmenu"}</div> <ul class="sf-menu clearfix menu-content"> {$MENU} </ul> </div> How can I alter the {$MENU} ? Link to comment Share on other sites More sharing options...
Rhobur Posted March 23, 2016 Share Posted March 23, 2016 I think a jquery script to check each item and then attach a class may be the solution. Link to comment Share on other sites More sharing options...
presta.show Posted March 23, 2016 Share Posted March 23, 2016 If you want edit <li> elements you must edit file /modules/blocktopmenu/blocktopmenu.php 1 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