Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Style category links based on hierarchy?

Style category links based on hierarchy?

Locked

Views: 1,136

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
3 Apr 2007, 10:51 PM
#1
mdonahue37 avatar

mdonahue37

New Zenner

Join Date:
Apr 2007
Posts:
2
Plugin Contributions:
0

Style category links based on hierarchy?

Here's my situation, I am setting up a site to sell photographic images online. I am trying to organize my categories to Veiw By..

My categories currently break down as such.

Photographer (top level)

Photographer Name 1 (second level)
Photographer Name 2 (second level)
Photographer Name 3 (second level)
Gallery (top level)
Abstracts (second level)
Landscape (second level)
Beaches (third level)
Mountains (third level)
Wildlife (second level)
Birds (third level)
Mammals (third level)
Here's my problem. When ZenCart assigns the class names to the links it doesn't use names like level1, level2, etc. It uses category-top, category-sub and category-product. So, even though categories like Photographer Name and Landscape are at the same level (second level) in the hierarchy they have different class names. And I can't simply apply the same styles to both class names because categories like Beaches and Birds (third level) would also pick it up.

What I'm trying to do (without success) is to add to the 2nd case statement (line 25) of the switch() function in tpl_categories.php to include an OR statement that says:** if your parent category is the "top" category then set class name to "category-sub".** I just can't seem to figure out the exact statement syntax.

Any programmers out there that can offer a suggestion?

16 Apr 2007, 6:37 PM
#2
mdonahue37 avatar

mdonahue37

New Zenner

Join Date:
Apr 2007
Posts:
2
Plugin Contributions:
0

Re: Style category links based on hierarchy?

Apologies for the bump, but I'm still in need of help with this. Are there any Zen masters out there that can offer advice on the matter?

I'm still trying to fix the problem at the switch statement. I can't seem to figure out how the script is reading the returned sql query.

Thank you,
Mike D.