Zen Cart Logo
Forums / Addon Sideboxes / Categories Dressing

Categories Dressing

Views: 531,649

Results 1,201 to 1,220 of 2,268
6 Feb 2010, 1:06 AM
#1201
gjh42 avatar

gjh42

Black Belt

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

Categories Dressing

It needs some more specificity to overcome some other rule. Add #categories```
#categories li.cat-top a:hover, #categories .catBoxHeading2 a:hover{background:#fff url(/includes/templates/custom/images/bc_cat_no_sub_hover.gif) no-repeat}

Also, if you are deleting unused rules, what about .catBoxHeading3 and .catBoxHeadingImg?
6 Feb 2010, 4:58 AM
#1202
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Re: Categories Dressing

gjh42:

It needs some more specificity to overcome some other rule. Add #categories```
#categories li.cat-top a:hover, #categories .catBoxHeading2 a:hover{background:#fff url(/includes/templates/custom/images/bc_cat_no_sub_hover.gif) no-repeat}

> Also, if you are deleting unused rules, what about .catBoxHeading3 and .catBoxHeadingImg?

Thanks so much!!!
We're still using .catBoxHeading3. Deleted .catBoxHeadingImg.

Thanks again for this awesome mod!!!
6 Feb 2010, 9:53 AM
#1203
adi2009 avatar

adi2009

New Zenner

Join Date:
Dec 2009
Location:
Sarajevo
Posts:
80
Plugin Contributions:
0

Re: Categories Dressing

gjh42:

adi2009 - My last post to you was specific about the location of categories and chcategories. It won't work correctly with them the other way. And you won't need to have two different settings, once a small change is made to a function in categories_dressing_functions.php. Essentially we need to make the code treat first level subcats as if they were top level cats. I will look at that soon and post the change required.

The stylesheet code will be something like
#chcategories ul ul ul {/hide all deeper than first subcategory lists - left box/
display: none;
}

#categoriesContent>ul>li>ul>li>a {/hide only first level subcategories - right box/
display: none;
}

In /includes/functions/extra_functions/categories_dressing_functions.php, find thisphp }//switch if ($test_level){ switch ('true'){ case ($cat_box_active_level[1] > $cat_depth): and add this just before it php case 7://full active subtree, others per level - treat first subcat like top - customized 20100205 for madijelovi if($cPath_top != $path_top){//only 1 top cat's subs $skip_cat = 1; break; } $cPath_top_special = (int)substr_replace($_GET['cPath'],'',0,strpos($_GET['cPath'],'_')+1) ;//remove before & incl 1st occurrence of _ in string $path_top_special = (int)substr_replace($path,'',0,strpos($path,'_')+1) ;//remove before & incl 1st occurrence of _ in string if($cPath_top_special != $path_top_special) $test_level = 1; break; to get this```php
case 7://full active subtree, others per level - treat first subcat like top - customized 20100205 for madijelovi
if($cPath_top != $path_top){//only 1 top cat's subs
$skip_cat = 1;
break;
}
$cPath_top_special = (int)substr_replace($GET['cPath'],'',0,strpos($GET['cPath'],'')+1) ;//remove before & incl 1st occurrence of _ in string
$path_top_special = (int)substr_replace($path,'',0,strpos($path,'
')+1) ;//remove before & incl 1st occurrence of _ in string
if($cPath_top_special != $path_top_special) $test_level = 1;
break;
}//switch
if ($test_level){
switch ('true'){
case ($cat_box_active_level[1] > $cat_depth):

> 
> You will want a define setting of '7|4|5' ; change the 4 and 5 if needed, but you must use the 7.


thank you Glenn for detail explanation regarding my last post, truly appreciate it. Following your instructions from your last post, this is what I done:

1. First,I set chcategories sidebox in the left and classic categories in right column

2.  This part of code I have insert in "stylesheet_categories_dressing.bak.css"

#chcategories ul ul ul {/hide all deeper than first subcategory lists - left box/
display: none;
}


and this part of code I have insert in "stylesheet_categories_dressing.css"

#categoriesContent>ul>li>ul>li>a {/hide only first level subcategories - right box/
display: none;
}


3. I have added /case 7/ successfully in "categories_dressing_functions.php" and used define setting of '7|4|5'

Result of all changes is that I know have someting that is close to soultion I need need, so it look like we are on right track :smile: Here's how it looks like now after changes:

- Left chcategories is now showing only top and first level subcategories but what is intresting that is only showing one record (categor./subcat.) and never more that one even with fact there are for example five 1stlevel subcategories, its always showing one (currently selected). 

- Right categories sidebox is now not showing 1st level subcategorie (in my case 1stlev.subcat. is Car Brand) and thats OK but it shows all 2nd level subcat. (Car Model), 3th level subcat. (Engine/year/hp) and 4thlevel subcat. (Spare part types).
I planned for this right sidebox to show only 4thlevel subcat. so I need some change in code to show only 4th level subcat. 
Than I could achieve same system as on [Example link](http://www.milneroffroad.com/categories.asp?cID=9234) I mention earlyer, for example: 

1. enduser chooses Car brand (1st l.s.) on the left sidebox chcategories, 
2. than Car model (2nd l.s.) in center page 
3. than he chooses Engine/year/hp (3th l.s.) also in center page 
4. then Spare part type (4 l.s. for example 'Brakes') 
5. and than at the end when he is viewing product listing - spare part list he is interested in, on right side (in right column) classic categories sidebox should appear,  which would show only  4th level subcat. ("Engine parts", "Brakes", "Suspenison" etc) for 'CarBrand'--->'Model'--->'Engine/year/hp' he choosed.
6 Feb 2010, 6:45 PM
#1204
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

Knowing the exact subcat levels to display helps. Will there ever be deeper levels of subcat?
I don't know why it is only showing one first subcat, so I have improved a few things and put a debug line in the function. Install this in place of the original case 7```php
case 7:// active subtree, active branches only, only 1st & 4th level - treat first subcat like top - customized 20100205 for madijelovi
if($cPath_top != $path_top){//only 1 top cat's subs
$skip_cat = 1;
break;
}
if($cat_depth == 1){//show all first level subs
echo '<br />first: '.$path;//debug
break;
}
if($cat_depth == 4){//check 4th level for active parent
$path_ids = explode('',$path);
$path_parent = $path_ids[count($path_ids)-2];
if (in_array($path_parent,explode('
',$_GET['cPath']))) break;//show only subcats w parent in $cPath
}
$skip_cat = 1;//skip all others
break;

6 Feb 2010, 7:49 PM
#1205
adi2009 avatar

adi2009

New Zenner

Join Date:
Dec 2009
Location:
Sarajevo
Posts:
80
Plugin Contributions:
0

Re: Categories Dressing

Amazing:clap: Glenn you are real Zen Guru:flex::clap: It exactly what my client had in mind and its working great.

Also, as you mentioned in your post, it outputed numbers like 'first: 147_199' I notice that part of code and uncomment it, so code now looks like this:

case 7:// active subtree, active branches only, only 1st & 4th level - treat first subcat like top - customized 20100205 for madijelovi
        if($cPath_top != $path_top){//only 1 top cat's subs
          $skip_cat = 1;
          break;
        }
        if($cat_depth == 1){//show all first level  subs
[B]//[/B]echo '<br />first: '.$path;//debug
          break;
        }
        if($cat_depth == 4){//check 4th level for active parent
          $path_ids = explode('_',$path);
          $path_parent = $path_ids[count($path_ids)-2];
          if (in_array($path_parent,explode('_',$_GET['cPath']))) break;//show only subcats w parent in $cPath
        }
        $skip_cat = 1;//skip all others
        break;  

and now its not shows paths, is this OK?

p.s. I just noticed that categories.php in right column is also showing when I am on 4th level subcategorie: when I am viewing Car Parts Types for example 'Brakes'; 'Engine Parts' 'Suspension' etc in main/center page, I am also seeing classic categories on right side (in right column) which is showing same list - Car Parts Types. I am not sure what part of code we should change so the categories on right side wouldnt be visible when users are viewing Car Parts Types..

Thank you!

6 Feb 2010, 9:32 PM
#1206
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

If you want the right sidebox to not show when the same set of subcats is displayed in the center, that can be done. I won't have much time to work on it for the rest of the weekend - will come back when I can.

7 Feb 2010, 7:22 PM
#1207
adi2009 avatar

adi2009

New Zenner

Join Date:
Dec 2009
Location:
Sarajevo
Posts:
80
Plugin Contributions:
0

Re: Categories Dressing

OK Glenn:bigups:

8 Feb 2010, 3:20 PM
#1208
georgiebrown avatar

georgiebrown

New Zenner

Join Date:
Jan 2010
Posts:
8
Plugin Contributions:
0

Re: Categories Dressing

Hi, I am very new to all this, a bit lost, and in need of kind help!

After installing the module only the first category has expanded to show the sub categories - I would like all the sub categories to show under each top category - how would I do this?

The instructions in v2.7.3 readme seem to imply the answer to this maybe in 'readme_ch_categories.txt' but I can't work out where this file resides?

Any help appreciated - Many thanks

8 Feb 2010, 3:37 PM
#1209
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

You do need the chcategories version for this.
Both readme files should be in the base of the mod fileset when you unzip it. You will need to edit filepaths for /your_template/ in the chcategories folder, then upload that /includes/ folder like the other one. Select the chcategories sidebox in Tools > Layout Boxes Controller.

8 Feb 2010, 3:49 PM
#1210
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

zubenubi - You have put the rules for ul#catGroup6_8 { and ul#catGroup7_12 { near the top of your stylesheet, where some of their settings are being overruled by later generic settings. They need to go down in the same section as the others:```
/example for custom category group styling/
ul#catGroup3 {


#categories ul#catGroup6_8 {
8 Feb 2010, 4:33 PM
#1211
georgiebrown avatar

georgiebrown

New Zenner

Join Date:
Jan 2010
Posts:
8
Plugin Contributions:
0

Re: Categories Dressing

Thanks Glenn you are a star! and such a quick response!

For some reason the readme files are not downloading - but your tip to activate the side box in the layout boxes controller has got the structure I wanted. I guess all I need to do now is just use the stylesheet_chcategories_dressing.css to customise the colours etc?

Many thanks

8 Feb 2010, 4:37 PM
#1212
zubenubi avatar

zubenubi

New Zenner

Join Date:
Jan 2010
Location:
Ireland
Posts:
88
Plugin Contributions:
0

Re: Categories Dressing

zubenubi:

Hi Glenn, thanks for replying, Unfortunately I'm doing this all on my laptop so I can't give you a link.

I'll attach my css files if your game for taking a look but at least I know that it is possible! So I'll keep plugging away.

Really cant think what the problem is i dont think i've done anything weird, I'm sure I'm not missing semicolons or anything, I can change other variables of a group but just not margin, padding or anything to do with background.

Hi, it's me again. I've still not managed to figure out what is going wrong with my catgroups so I've made my site live even tho its not finnished yet so you can see it.

If anyone feels like taking a look I'd really really appreciate it!

https://www.babyclothingcentral.co.uk

8 Feb 2010, 4:39 PM
#1213
zubenubi avatar

zubenubi

New Zenner

Join Date:
Jan 2010
Location:
Ireland
Posts:
88
Plugin Contributions:
0

Re: Categories Dressing

gjh42:

zubenubi - You have put the rules for ul#catGroup6_8 { and ul#catGroup7_12 { near the top of your stylesheet, where some of their settings are being overruled by later generic settings. They need to go down in the same section as the others:```
/example for custom category group styling/
ul#catGroup3 {

> 
> #categories ul#catGroup6_8 {

Hi there, I only spotted your post after I had already posted. Thanks for you help!
8 Feb 2010, 5:16 PM
#1214
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

adi - Here is a new case 7 that should give the fourth level subcats only when at the fourth level.```php
case 7:// active subtree, active branches only, only 1st & 4th level - treat first subcat like top - customized 20100205 for madijelovi
if($cPath_top != $path_top){//only 1 top cat's subs
$skip_cat = 1;
break;
}
if($cat_depth == 1){//show all first level subs
break;
}
if($cat_depth == 4 and substr_count($GET['cPath'],'') == 4){//check 4th level for active parent, only for $cPath depth 4
$path_ids = explode('',$path);
$path_parent = $path_ids[count($path_ids)-2];
if (in_array($path_parent,explode('
',$_GET['cPath']))) break;//show only subcats w parent in $cPath
}
$skip_cat = 1;//skip all others
break;

8 Feb 2010, 6:52 PM
#1215
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

Re: post 1208: It appears I left the readme_ch_categories.txt out of the v2.7.3 zip. It has no real information beyond that already mentioned, so it should not cause any further problem. I'll make sure it gets in the v2.8 zip.

12 Feb 2010, 9:05 PM
#1216
amyleew avatar

amyleew

Zen Follower

Join Date:
Jul 2009
Posts:
159
Plugin Contributions:
0

Re: Categories Dressing

If I add Categories Dressing and put a few headings there like shop by brand, theme, new products etc. how do I go about adding new categories under them. For example I get something new in with a different theme, how do I put a new theme under that section without it going under say, brand. Does it work by the sort order or does it alter the look of Catalog > Categories/Products or some other way?

I haven't added it yet because it looks really hard. The read me scared me off but I am still keen to put some structure to my categories and make them look a little more user friendly.

12 Feb 2010, 9:25 PM
#1217
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

The category headings work simply by putting a block of content above a particular category in the sidebox. The category display order is the sort order you set in Categories/Products.
If you set the sort orders like 10, 20, 30, etc. it will be easy to add new categories in between.
If you get a new category that belongs above the one at the top of its group, you would have to transfer the heading to the new category. That is done by changing one number in a define statement.

Some parts of it are complex, but that is for complex requirements. Adding headings is straightforward, as long as you can follow directions.

12 Feb 2010, 9:29 PM
#1218
amyleew avatar

amyleew

Zen Follower

Join Date:
Jul 2009
Posts:
159
Plugin Contributions:
0

Re: Categories Dressing

Thanks. I am going to give it a try today. Thanks Glenn. I have to say, its comforting knowing that you give such great support for this. Thanks.

13 Feb 2010, 11:49 PM
#1219
amyleew avatar

amyleew

Zen Follower

Join Date:
Jul 2009
Posts:
159
Plugin Contributions:
0

Re: Categories Dressing

It's safe to say I am stupid. I don't even know where to start.

I have Categories Dressing installed and all I want to do is put a few simple divider lines in to split up categories a bit. I don't need headings and I don't want all of my sub-folders displayed (worked out how to fix that).

Can I just be completely stupid and ask what do I do next. I have read the read me a million times and I am about 50 pages through this thread and I am still none the wiser on what to do next. Am I missing a page or it or something??

I can see from the read me that I need to define the cpath or whatever but I can't even find where I do that. Firstly, what is the filename that I do that in? Do I have to add in that 'define ('CAT_BOX_HEADING_52','0|1||;//divider only - style 1 line' somewhere or should it be in there waiting for me already to edit it. If I have to add it in... where do I do that? :blink:

16 Feb 2010, 5:04 AM
#1220
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

Under "Application"
To apply any of the following modifications, locate the defines shown in your categories_dressing_defines.php,

/includes/languages/english/extra_definitions/categories_dressing_defines.php

define ('CAT_BOX_HEADING_52','0|1||;
Change the 52 to whatever the cPath= says in the top address bar when you are on the category you want a divider above.

Copy and make one for each category needed.

Also, comment out all the CAT_BOX_HEADING_ defines you don't want to use (put // in front of the whole line).