Zen Cart Logo
Forums / Addon Templates / How do I make the CSS category menu display only top-level categories?

How do I make the CSS category menu display only top-level categories?

Views: 2,666

Results 1 to 5 of 5
18 Jun 2015, 5:28 AM
#1
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

How do I make the CSS category menu display only top-level categories?

http://joburgonline.com

Hi Anne

Can't find an answer on the forum to my issue below, and have scoured/toggled the admin options.

I have many sub-categories. These drop off the bottom of one's desktop when navigating deeper and deeper into the options. I manage to scroll down, but site visitors don't, or can't. have also reduced sub categories significantly.

Is it possible to switch the sub-categories menu off, so that only the top categories are in the main page menu? Clicking on a top category will then take you to a page displaying the sub-category options (this already works, but not all think that way, get frustrated and go back to google).

Looking forward to your reply

18 Jun 2015, 1:41 PM
#2
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: How do I make the CSS category menu display only top-level categories?

Parafanaylya:

http://joburgonline.com

Hi Anne

Can't find an answer on the forum to my issue below, and have scoured/toggled the admin options.

I have many sub-categories. These drop off the bottom of one's desktop when navigating deeper and deeper into the options. I manage to scroll down, but site visitors don't, or can't. have also reduced sub categories significantly.

Is it possible to switch the sub-categories menu off, so that only the top categories are in the main page menu? Clicking on a top category will then take you to a page displaying the sub-category options (this already works, but not all think that way, get frustrated and go back to google).

Looking forward to your reply

Yes, you will need to modify the code in the includes/classes/categories_ul_generator.php file.

Thanks,

Anne

24 Jun 2015, 3:52 AM
#3
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: How do I make the CSS category menu display only top-level categories?

picaflor-azul:

Yes, you will need to modify the code in the includes/classes/categories_ul_generator.php file.

Thanks,

Anne
How should it be changed? i.e. what do I remove/modify?

1 Jul 2015, 5:17 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How do I make the CSS category menu display only top-level categories?

  1. I might suggest that if your customers are having difficulty navigating your category structure that you come up with another way to display your categories so your customers can find them more intuitively. ie: if the current menu system isn't suitable for your customers, use another one that is.

  2. To force the categories_ul_generator to process only 1 level instead of 6, change the $max_level from 6 to 1 in categories_ul_generator.php:```
    class zen_categories_ul_generator {
    var $root_category_id = 0,
    $max_level = [B]6[/B],

1 Jul 2015, 5:51 PM
#5
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: How do I make the CSS category menu display only top-level categories?

DrByte:

  1. I might suggest that if your customers are having difficulty navigating your category structure that you come up with another way to display your categories so your customers can find them more intuitively. ie: if the current menu system isn't suitable for your customers, use another one that is.

  2. To force the categories_ul_generator to process only 1 level instead of 6, change the $max_level from 6 to 1 in categories_ul_generator.php:```
    class zen_categories_ul_generator {
    var $root_category_id = 0,
    $max_level = [B]6[/B],


Thanks DrByte

I changed mine from 

class zen_categories_ul_generator {
var $root_category_id = 0,
$max_level = 0,

to

class zen_categories_ul_generator {
var $root_category_id = 0,
$max_level = 1,


And it's working! :smile: