Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / how to keep categories unfolded on sidebox?

how to keep categories unfolded on sidebox?

Views: 12,609

Results 21 to 40 of 43
10 Jun 2009, 8:17 PM
#21
hflsales avatar

hflsales

New Zenner

Join Date:
Mar 2009
Posts:
88
Plugin Contributions:
0

how to keep categories unfolded on sidebox?

anap:

Anyone else having problems with breadcrumbs after installing? All top level categories with a sort number higher than the current category are being displayed. :frusty:

i.e. instead of:
Home > Sweaters > Women's Sweaters

I am now getting:
Home > Belts > Tshirts -> Shorts > Sweaters > Women's Sweaters

I am having a problem with the breadcrumbs as well. It always says "Home", regardless of what subcategory you are in.

10 Jul 2009, 3:59 PM
#22
haggis0929 avatar

haggis0929

New Zenner

Join Date:
Feb 2009
Posts:
41
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

After much searching, and reading about different ways to handle this, I ended up using the mod at

http://plone.held-im-ruhestand.de/software/zen-cart-categories

EXTEMELY easy to install - no code to edit either. Just unzip, upload 2 files, then go into your Tools/Layout Boxes Controller, and turn on the new "ch_categories" and turn off "categories". Works great! :clap:

Reason I used this is so I don't have to go edit the categories_tree file every time we add a new category with a subcategory.

I should also mention that as of now, we only have 1 subcategory in any category, so I'm not sure what will happen if we have more than 1 subcat.

19 Sep 2009, 10:37 AM
#23
enochian avatar

enochian

New Zenner

Join Date:
Jan 2009
Posts:
33
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

This is a very good simple way to keep the catergories expanded but it's says that you can just expand one or as many catergories as you want but when I expanded just one of my categories my level 3 sub catergory would not expand when I clicked on it and instead of showing the products in the main section it showed all the products.

Anyone got any ideas???:huh:

22 Jun 2010, 11:00 AM
#24
chickenlover avatar

chickenlover

New Zenner

Join Date:
Jun 2010
Posts:
1
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

sotlordrahl:

This is how I hacked up the zen-cart code to have the ability to unfold ANY or ALL categories to display sub-cats on all pages, not just the index page:

open 'includes/classes/category_tree.php'

  1. change line 137

change

if (zen_not_null($cPath)) {

TO =>

if (zen_not_null($cPath) or 1) {


  1. insert code in lines 141-145

ORIGINAL

reset($cPath_array);

while (list($key, $value) = each($cPath_array)) {


insert =>

$cPath_array = array(#,#);

in between the reset and while commands.

equals the category ID you wish to be unfolded... you can have it only unfold one, or all... all would be #,#,#,#,# and so on until you have all the ID's inside the parenthesis.

END RESULT

reset($cPath_array);

$cPath_array = array(1,2,5,7);

while (list($key, $value) = each($cPath_array)) {


hope this helps some people, my buddy and I spent 2 hours trying to figure this one out. tried to add some hyphens in here for reading pleasure and such... do not insert the page breaks I made. ENJOY!!!

Any questions let me know, this is what worked for me.

Many thanks for posting this Zotlordrahl. It worked great and of course kept my chosen template theme. I've been working on Zen Cart projects for a month now and use this forum loads - had to register to thank you for this.:clap:

7 Nov 2010, 2:08 PM
#25
boknots avatar

boknots

New Zenner

Join Date:
Aug 2010
Posts:
7
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

Hours and hours and hours of searching for this solution. THANK YOU!!! works perfectly!! :smile::smile::smile:

17 Nov 2010, 3:28 AM
#26
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

Also working for me, 1.3.9h cart. Thanks!

PS: Code was on different lines in 1.3.9h cart, used the find function in editor.

17 Nov 2010, 6:58 PM
#27
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

Okay, this morning I googled and read that for SEO it's probably best to leave subcats closed! Theme siloing and link dilution was the reason. I suppose that the basic zen cart layout is the best for seo afterall, including dynamic urls.....

18 Nov 2010, 12:17 AM
#28
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: how to keep categories unfolded on sidebox?

I think the most important factor here is what is best for your customers' ease of use. Only if the menu status does not impact them materially should you change for SEO.

haggis0929 - The Uncollapsed Categories Tree mod will work for any number of subcat levels, expanding them all, all the time.

2 Dec 2010, 7:58 PM
#29
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

Thanks. I'm re-visiting opening all subcats. However, while it worked when I only had one cat with subcats, it now does not work with several cats with subcats.

1.3.9h
Barebones template
Categories Dressing mod

Where do I obtain this Uncollapsed Categories Tree mod?

2 Dec 2010, 8:20 PM
#30
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

Okay, mod edit on first page of this thread now working:

http://www.prommart.com/

But I had to use/work with the code in post #6.

1.3.9H ZC

Now have to look at my Categories Dressing mod.

2 Dec 2010, 10:22 PM
#31
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

Problem: In Nav Bread Crumbs ALL of the expanded cats/subcats show when on a product page (if you get to product from expanded cat sidebox).

Furthermore, clicking on one of the many cats in the nav crumb is not reliable: It may say your category, but show sub cats from another category.

This mod, although simple and it does expand the cats and looks nice, may be too simple, unless one turns off bread crumbs. I don't want to.

I'll look at Yellow's cat tree post. More complex; wonder if it also shows everything in breadcrumb?

3 Dec 2010, 1:25 AM
#32
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

Solution: my main site uses dynamic url's, which causes the nav breadcrumb problem. And each product shows all of the cats listed in the array in the browser url address bar.

My test site uses simple seo url. It seems to work.

Dynamic url's are the problem?

3 Dec 2010, 8:30 AM
#33
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: how to keep categories unfolded on sidebox?

"Categories Dressing mod

Where do I obtain this Uncollapsed Categories Tree mod? "

Uncollapsed Categories Tree is packaged in the Categories Dressing zip, and the readme describes how to install and use it.

3 Dec 2010, 4:50 PM
#34
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

gjh42:

"Categories Dressing mod

Where do I obtain this Uncollapsed Categories Tree mod? "

Uncollapsed Categories Tree is packaged in the Categories Dressing zip, and the readme describes how to install and use it.

Thanks! I've used your Categories Dressing mod like forever, it's on my site now (although never used to it's full potential):

https://www.prommart.com

I have subcats showing in another font color.

I could probably accomplish what I'm trying to do (group designers by their various divisions) using a non-linked heading (or pic) with Cat Mod and making it look nice, and returning subcats to top level. But that will entail a learning curve, as all I've really done is use the line separator.

I'll check the Categories Dressing mod again, maybe download again, and take a look at the uncollapsed categories tree.

Steve

Yes! New download appears to have more than my old one.

3 Dec 2010, 4:56 PM
#35
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: how to keep categories unfolded on sidebox?

  • Categories Dressing v2.2 Glenn Herbert (gjh42) 2008-05-08

I packaged Uncollapsed Categories Tree with Cat Dressing in v2.7, and there are lots of improvements in functionality in the most recent version as well.

3 Dec 2010, 5:14 PM
#36
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: how to keep categories unfolded on sidebox?

You may want to look at the zip of v2.8 in the support thread, post 1542 (not yet released in Free Addons), as it makes some things easier than previous versions as well as having enhanced functionality.

3 Dec 2010, 10:59 PM
#37
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

Thanks! I'll go to the Cat Dressing thread, get the new zip, and make any further posts there.

But already, your updated version seems much more user friendly.

27 Mar 2011, 4:21 AM
#38
kadlinny avatar

kadlinny

New Zenner

Join Date:
Mar 2011
Posts:
1
Plugin Contributions:
0

Re: how to keep categories unfolded on sidebox?

sotlordrahl:

This is how I hacked up the zen-cart code to have the ability to unfold ANY or ALL categories to display sub-cats on all pages, not just the index page:

open 'includes/classes/category_tree.php'

  1. change line 137

change

if (zen_not_null($cPath)) {

TO =>

if (zen_not_null($cPath) or 1) {


  1. insert code in lines 141-145

ORIGINAL

reset($cPath_array);

while (list($key, $value) = each($cPath_array)) {


insert =>

$cPath_array = array(#,#);

in between the reset and while commands.

equals the category ID you wish to be unfolded... you can have it only unfold one, or all... all would be #,#,#,#,# and so on until you have all the ID's inside the parenthesis.

END RESULT

reset($cPath_array);

$cPath_array = array(1,2,5,7);

while (list($key, $value) = each($cPath_array)) {


hope this helps some people, my buddy and I spent 2 hours trying to figure this one out. tried to add some hyphens in here for reading pleasure and such... do not insert the page breaks I made. ENJOY!!!

Any questions let me know, this is what worked for me.
Hi there! I made this change to includes/classes/category_tree.php and it ALMOST works except that the link for one of the subcategories is incorrect. It directs to the product listing of another subcategory.

Women (cPath=18)
-- Sandals (cPath=18_21)
-- Fur Accessories (cPath=18_22 - properly pulls up the page with additional subcategories for items like gloves, etc)
Men (cPath=17)
-- Sandals (cPath=18_17_19 - but still links properly to the men's sandals)
-- Fur Accessories (cPath=18_17_20 - but DOES NOT properly link to the men's page with additional subcats for items like slippers, etc but rather links to the WOMEN'S)

Please, help! I've been trying to fix this for hours. I hope someone has a fix out there! Thank you.

My cPath_array is : $cPath_array = array(18,17,21,19,20,22);

Using zencart v 1.3.9h

28 Mar 2011, 2:20 PM
#39
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: how to keep categories unfolded on sidebox?

If you are not trying something fancy like expanding only some of the categories, forget editing code on your own and install Uncollapsed Categories Tree (detailed in previous posts), which just works reliably without adjustments.

24 Apr 2011, 8:09 AM
#40
dachilla avatar

dachilla

New Zenner

Join Date:
Feb 2006
Posts:
66
Plugin Contributions:
1

Re: how to keep categories unfolded on sidebox?

Great mod! Thank you!