Jump to content

How to disable sub-category drop down menu in blocktopmenu?


Recommended Posts

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

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

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

  • 2 months later...

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

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

  • 1 month later...

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 :blink: IT WORKED !!!

 

Thank you sshare !

Link to comment
Share on other sites

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!!!

  • Like 7
Link to comment
Share on other sites

  • 3 weeks later...
  • 3 months later...

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

  • 4 months later...

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 ...

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

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

  • 3 weeks later...
  • 3 months later...
  • 3 months later...
  • 1 month later...

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

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

  • 1 year later...

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>';
            // }
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
×
×
  • Create New...