Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Always expand categories?

Always expand categories?

Locked

Views: 4,856

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
10 May 2007, 3:48 PM
#1
madk avatar

madk

Zen Follower

Join Date:
Jun 2006
Location:
Michigan
Posts:
162
Plugin Contributions:
0

Always expand categories?

Hello all,

I doing a little updating to my site and I need some help. In the past whenever there wasn't anything I could figure out I just removed the zen functions and hard coded everything. I did this for my left column that contained all the links to my product categories.

I did this because I need all the categories to be expanded at all times. I'm pretty sure there has to be an easy way to accomplish this but I have yet to find it. If anyone has any suggestions I would greatly appreciate it.

Thank you,
mdk

10 May 2007, 4:20 PM
#2
madk avatar

madk

Zen Follower

Join Date:
Jun 2006
Location:
Michigan
Posts:
162
Plugin Contributions:
0

Re: Always expand categories?

Ok I'm doing a bit of digging to see if I can figure this out on my own. So far I am overriding categories.php and tpl_categories.php.

categoies.php loads all the top-level cats into an array and then tpl_categories outputs this array.

When you enter a category page does it use a different sidebox to display the categories?

10 May 2007, 4:42 PM
#3
madk avatar

madk

Zen Follower

Join Date:
Jun 2006
Location:
Michigan
Posts:
162
Plugin Contributions:
0

Re: Always expand categories?

Ok it appears that the array which holds the categories is a different size depending upon which page you are on. Although it appears that the database call is the same for each page.

There must be something else going on with the db.

14 May 2007, 3:07 PM
#7
fakedecoy avatar

fakedecoy

Zen Follower

Join Date:
Jul 2006
Posts:
309
Plugin Contributions:
0

Re: Always expand categories?

Ok, I've tried the ch_category mod and it does seem to work fine. Someone just posted recently describing how it wasn't creating the tree correctly, but I don't see a problem.

I have more items in the Documents menu that also need to be expanded, so it looks like I'll need another class file and sidebox menu file. So hopefully I can figure out how to modify a copy of t to pull the products that would normally display in the documents menu, the same way ch_category pulls the products that are normally displayed in the categories menu.

5 Jun 2010, 12:59 AM
#8
centerlasered avatar

centerlasered

New Zenner

Join Date:
May 2010
Posts:
2
Plugin Contributions:
0

Re: Always expand categories?

I know this thread is 3 years old, but it's exactly what I am looking for and I can't seem to find any info on how to get the documents categories expanded.

5 Jun 2010, 4:46 AM
#9
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: Always expand categories?

I actually JUST found out how to do this myself.

  1. I Duplicated the files that came with ch_categories. I just named them:
    ch_categories_tree_generator2.php
    ch_categories2.php

  2. I opened up ch_categories_tree_generator2.php and changed the first line

class ch_category_tree

to

class ch2 _category_tree

[the part in red is what I added.]

  1. Then I opened ch_categories2.php. Found around the 3rd line:

$main_category_tree = new ch_category_tree;

and changed it to:

$main_category_tree = new ch2_category_tree;

Then I found my new sidebox in Admin->Layout Boxes Controller. [It was named ch_categories2.php if]

Finally the Document Categories Expanded to show subcategories.