sshare Posted November 11, 2012 Share Posted November 11, 2012 Hi everyone, Just wondering if it's possible to disable the sub-category drop down part of the blocktopmenu? Basically I only want the main categories to show on the top menu bar/block and not the sub-categories. If yes and someone has already done this could you please tell me what to modify to get the desired result? Thanks in advance. Link to comment Share on other sites More sharing options...
yaniv14 Posted November 11, 2012 Share Posted November 11, 2012 Try in back office -> modules -> modules -> categories block -> configure. and set maximum depth to 1. I am not sure but give it a shot Link to comment Share on other sites More sharing options...
sshare Posted November 12, 2012 Author Share Posted November 12, 2012 Thanks for the suggestion, never would've looked for a complete module for this coming from 1.4.x. Unfortunately it didn't work, also tried setting "dynamic" to off, which didn't have any effect either, so still stuck on this one. Link to comment Share on other sites More sharing options...
sshare Posted November 12, 2012 Author Share Posted November 12, 2012 Also I may be wrong but I think the blocktopmenu has nothing to do with the categories block as that's the one that is often found on the left, the one I mean is the horizontal one. Link to comment Share on other sites More sharing options...
sshare Posted November 12, 2012 Author Share Posted November 12, 2012 Think I figured it out. In blocktopmenu.php I uncommented the following lines of code (starts at line 647 and ends at line 655): if (count($children)) { $this->_menu .= '<ul>'; foreach ($children as $child) $this->getCategory((int)$child['id_category'], (int)$id_lang, (int)$child['id_shop']); $this->_menu .= '</ul>'; } And it now doesn't show the drop down anymore. Only I'm not sure if this is the correct way of going about it, so if there is someone out there that knows please confirm or let me know how to do it properly. Link to comment Share on other sites More sharing options...
builders Posted January 15, 2013 Share Posted January 15, 2013 Think I figured it out. In blocktopmenu.php I uncommented the following lines of code (starts at line 647 and ends at line 655): And it now doesn't show the drop down anymore. Only I'm not sure if this is the correct way of going about it, so if there is someone out there that knows please confirm or let me know how to do it properly. I have tested your solution but no luck it is still showing the sublevels IS there any other solution ?? Thanks Link to comment Share on other sites More sharing options...
blueraccoon Posted January 22, 2013 Share Posted January 22, 2013 I simply removed the CSS that relates to the dropdown part of the menu so there is nothing to be seen. Probably not the right way; but it works!! Cheers. Link to comment Share on other sites More sharing options...
benjamin utterback Posted January 22, 2013 Share Posted January 22, 2013 Hi blueraccoon, which .css files did you remove in Block Top Menu to acheive this? I'm sure it would help the user builders. Thank you for the support! -Benjamin 2 Link to comment Share on other sites More sharing options...
blueraccoon Posted January 22, 2013 Share Posted January 22, 2013 For me it was in the following location; but I am not using the default template so it may not be the same. The Web Developer toolbar extension for Firefox will soon reveal its location. /themes/yourtheme/css/modules/blocktopmenu/css/superfish-modified.css Could you please help me with the following topic Benjamin? http://www.prestashop.com/forums/topic/218583-multistore-sub-directories/ Cheers. Link to comment Share on other sites More sharing options...
builders Posted January 23, 2013 Share Posted January 23, 2013 That havent worked for me either. Which part of css have you removed ? Is there any other solution more reliable or correct ? Thanks Link to comment Share on other sites More sharing options...
blueraccoon Posted January 23, 2013 Share Posted January 23, 2013 Is the website live? If I can see it I can tell you. Cheers. Link to comment Share on other sites More sharing options...
zAy Posted March 1, 2013 Share Posted March 1, 2013 I did what (sshare) suggested.. comment the following in modules/blocktopmenu/blocktopmenu.php starting at line 647 /* if (count($children)) * { * $this->_menu .= '<ul>'; * * foreach ($children as $child) * $this->getCategory((int)$child['id_category'], (int)$id_lang, (int)$child['id_shop']); * * $this->_menu .= '</ul>'; * } */ and it didn't work BUT I CLEARED those folders: /cache/smarty/cache/ and /cache/smarty/compile/ and IT WORKED !!! Thank you sshare ! Link to comment Share on other sites More sharing options...
FancifulFlights Posted March 4, 2013 Share Posted March 4, 2013 Hi, I've discovered a pretty simple way to disable the drop down menu in the horizontal top bar without touching any code. 1) Go into your module editor for the blocktopmenu 2) Remove the default "home" link by clicking on "home" in the right window under settings, then click on "remove". 3) Under the heading "Add Top Menu Link" type "Home" in the label field, enter your website URL in the link field and click "add". 4) Go back up to settings, scroll down in the left window and under the bold heading "Top Menu Links" you will see the new "home" link you just made. Click on that link click on "add" located under the window. DONE!! If you want the "Home" link to the the first on the menu bar then you will need to remove all existing links and add them back in the order you want them to appear. Easy!!! 7 Link to comment Share on other sites More sharing options...
benjamin utterback Posted March 4, 2013 Share Posted March 4, 2013 Thank you FancifulFlights, I will monitor this thread to see if your solution works for others. Thank you for choosing PrestaShop! Link to comment Share on other sites More sharing options...
kalbinsson Posted March 24, 2013 Share Posted March 24, 2013 Thanks, Excellent solution provided by FancifulFlights. Worked for me in 1.5.3.1. /K 1 Link to comment Share on other sites More sharing options...
jocuri Posted March 25, 2013 Share Posted March 25, 2013 For this i choose PrestaShop, because is the best ecommerce script _____________________________________________________________________________________ joc jocuri barbie si jocuri de gatit pe acest site cu jocuri Link to comment Share on other sites More sharing options...
FancifulFlights Posted March 25, 2013 Share Posted March 25, 2013 Thanks, Excellent solution provided by FancifulFlights. Worked for me in 1.5.3.1. /K You are most welcome! I cannot believe how easy it was to over look such a simple solution! ~ T Link to comment Share on other sites More sharing options...
spexistechnology Posted July 17, 2013 Share Posted July 17, 2013 Hi, I've discovered a pretty simple way to disable the drop down menu in the horizontal top bar without touching any code. 1) Go into your module editor for the blocktopmenu 2) Remove the default "home" link by clicking on "home" in the right window under settings, then click on "remove". 3) Under the heading "Add Top Menu Link" type "Home" in the label field, enter your website URL in the link field and click "add". 4) Go back up to settings, scroll down in the left window and under the bold heading "Top Menu Links" you will see the new "home" link you just made. Click on that link click on "add" located under the window. DONE!! If you want the "Home" link to the the first on the menu bar then you will need to remove all existing links and add them back in the order you want them to appear. Easy!!! Thanks for the solution..Didn't work for me for the first time. I had to delete and then create the home link again to get it work the 2nd time. Link to comment Share on other sites More sharing options...
Joytia1999 Posted December 4, 2013 Share Posted December 4, 2013 Hi, I've discovered a pretty simple way to disable the drop down menu in the horizontal top bar without touching any code. 1) Go into your module editor for the blocktopmenu 2) Remove the default "home" link by clicking on "home" in the right window under settings, then click on "remove". 3) Under the heading "Add Top Menu Link" type "Home" in the label field, enter your website URL in the link field and click "add". 4) Go back up to settings, scroll down in the left window and under the bold heading "Top Menu Links" you will see the new "home" link you just made. Click on that link click on "add" located under the window. DONE!! If you want the "Home" link to the the first on the menu bar then you will need to remove all existing links and add them back in the order you want them to appear. Easy!!! Thanks is working to me also ... 1 Link to comment Share on other sites More sharing options...
Michallius Posted January 26, 2014 Share Posted January 26, 2014 Think I figured it out. In blocktopmenu.php I uncommented the following lines of code (starts at line 647 and ends at line 655): And it now doesn't show the drop down anymore. Only I'm not sure if this is the correct way of going about it, so if there is someone out there that knows please confirm or let me know how to do it properly. Thanks, work fine! Link to comment Share on other sites More sharing options...
Enoteca Posted February 10, 2014 Share Posted February 10, 2014 FancifulFlights solution not only solves the mistery from the BO but also allows to add any text, that can be linked or not (by appropriate css settings). Two pigeons with one catch! Link to comment Share on other sites More sharing options...
Ron morales Posted May 15, 2014 Share Posted May 15, 2014 (edited) In ps 1.6 how to make dropdown onclik in subcategories? how one picture, two picture my web on hover, but navegation mobile no work fine, the best on click, thanks Edited May 15, 2014 by Ron morales (see edit history) Link to comment Share on other sites More sharing options...
Ron morales Posted May 20, 2014 Share Posted May 20, 2014 In ps 1.6 how to make dropdown onclik in subcategories? how one picture, two picture my web on hover, but navegation mobile no work fine, the best on click, thanks solved with a module Link to comment Share on other sites More sharing options...
wael_hossam Posted August 28, 2014 Share Posted August 28, 2014 Guys my problem was exactly the contrary as I don't see sub-categories and I want to see them in the top menu. I used to have it on version 1.5 but since I upgraded to 1.6 the subcategories disappeared. What can be the reason? Link to comment Share on other sites More sharing options...
merlin_buzz Posted October 27, 2014 Share Posted October 27, 2014 Hi I have a similar issue. Here's the link to the test website http://breithof.be/verre_couvert/Quickstart/fr/ La Verrerie is one category, under which you have several subcategories. I only want to display the first category on the dropdown menu (i.e vin, soft, bières etc) so only one level but all categories should be displayed on a category page. For example if I click on "vin" all the subcategories should be on a page. So how can I do this? Many thanks for your help. Regards Al Link to comment Share on other sites More sharing options...
vekia Posted October 27, 2014 Share Posted October 27, 2014 Hi I have a similar issue. Here's the link to the test website http://breithof.be/verre_couvert/Quickstart/fr/ La Verrerie is one category, under which you have several subcategories. I only want to display the first category on the dropdown menu (i.e vin, soft, bières etc) so only one level but all categories should be displayed on a category page. For example if I click on "vin" all the subcategories should be on a page. So how can I do this? Many thanks for your help. Regards Al use this code in global stylesheet file: .sf-menu ul li ul {display:none!important} Link to comment Share on other sites More sharing options...
merlin_buzz Posted October 27, 2014 Share Posted October 27, 2014 Oh great, Many thanks and thanks for the swift reply Link to comment Share on other sites More sharing options...
vekia Posted October 28, 2014 Share Posted October 28, 2014 does this code snippet work as you expected? Link to comment Share on other sites More sharing options...
merlin_buzz Posted October 28, 2014 Share Posted October 28, 2014 Yes it does...everything perfect thkx Link to comment Share on other sites More sharing options...
Kerm Posted July 27, 2016 Share Posted July 27, 2016 Hide subcategories in css is bad way to fix this problem, is kinda lame, if you have vershion 1.6.1 i recommend inside file modules/blocktopmenu/blocktopmenu.php comment inside function generateCategoriesMenu() this lines: // if (isset($category['children']) && !empty($category['children'])) { // $html .= '<ul>'; // $html .= $this->generateCategoriesMenu($category['children'], 1); // if ((int)$category['level_depth'] > 1 && !$is_children) { // $files = scandir(_PS_CAT_IMG_DIR_); // if (count(preg_grep('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $files)) > 0) { // $html .= '<li class="category-thumbnail">'; // foreach ($files as $file) { // if (preg_match('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $file) === 1) { // $html .= '<div><img src="'.$this->context->link->getMediaLink(_THEME_CAT_DIR_.$file) // .'" alt="'.Tools::SafeOutput($category['name']).'" title="' // .Tools::SafeOutput($category['name']).'" class="imgm" /></div>'; // } // } // $html .= '</li>'; // } // } // $html .= '</ul>'; // } 1 Link to comment Share on other sites More sharing options...
marekmarek123 Posted August 12, 2016 Share Posted August 12, 2016 css is good but is not the best way, because for robtos/google/seo you want to hide something so it is wrong way. better is to do this by override this module like Kerm wrote Link to comment Share on other sites More sharing options...
bigdeti Posted August 13, 2016 Share Posted August 13, 2016 hmm.. such an important feature... and ther´s no way to able/disable it via backoffice-admin? Link to comment Share on other sites More sharing options...
Kerm Posted August 15, 2016 Share Posted August 15, 2016 hmm.. such an important feature... and ther´s no way to able/disable it via backoffice-admin? No, you can not. Link to comment Share on other sites More sharing options...
Recommended Posts