Zen Cart Logo
Forums / Addon Sideboxes / Categories Dressing

Categories Dressing

Views: 531,648

Results 1,161 to 1,180 of 2,268
1 Feb 2010, 8:36 PM
#1161
adi2009 avatar

adi2009

New Zenner

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

Categories Dressing

gjh42:

OK, that makes it easy.
You didn't mention your current setting for
define('CAT_BOX_ACTIVE_LEVEL', '#|#|#')

It should probably be

define('CAT_BOX_ACTIVE_LEVEL', '0|1|1')

The function code is not the setting, and yours shows that it is the standard version of the function.

OK, I changed code in categories_dressing_functions.php saved/upload it and it now it looks like this:

function cat_active_level_manage($path) {
$skip_cat = 0;
if (defined('CAT_BOX_ACTIVE_LEVEL','0|1|1')) {
$test_level = 0;
$cat_box_active_level = explode('|',constant('CAT_BOX_ACTIVE_LEVEL'));
$cPath_top = (int)$GET['cPath'];
$path_top = (int)$path;
$cat_depth = substr_count($path,'
');
//tests for various kinds of skipping - more can be added
switch ($cat_box_active_level[0]){
case 0:
$test_level = 1;
break;
case 1://active tree only
if($cPath_top != $path_top) $skip_cat = 1;
break;
case 2://active only (all tops when no cat selected)
if($cPath_top != $path_top and $cPath_top != 0) $skip_cat = 1;
break;
case 3://full active tree, others per level
if($cPath_top != $path_top) $test_level = 1;
break;
case 4://like 3, active branches only
if($cPath_top == $path_top){
if ($cat_depth >= 2){//only test sub-subcats+
$path_ids = explode('',$path);
$path_parent = $path_ids[count($path_ids)-2];
if (!in_array($path_parent,explode('
',$_GET['cPath']))) $skip_cat = 1;//show only subcats w parent in $cPath
}
} else {//if not active test for level
$test_level = 1;
}
break;
case 5:// show active, no top, per levels
if ($cat_depth == 0 or $cPath_top != $path_top) {
$skip_cat = 1;
}else{
$test_level = 1;
}
break;
}//switch
if ($test_level){
switch ('true'){
case ($cat_box_active_level[1] > $cat_depth):
$skip_cat = 1;
break;
case ($cat_box_active_level[2] < $cat_depth):
$skip_cat = 1;
break;
}//switch
}//if
}//defined
return $skip_cat;
}

but no changes on left sidebox on website (you can check it out when you click on "Selling parts" in top menu bar)

1 Feb 2010, 8:44 PM
#1162
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

No! You don't want to change the code in categories_dressing_functions.php at all.

Set the define in /includes/languages/english/extra_definitions/your_template/categories_dressing_defines.php as shown.

1 Feb 2010, 8:59 PM
#1163
adi2009 avatar

adi2009

New Zenner

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

Re: Categories Dressing

Yes, I also just checked some of the older post in meantime, on this thread (link) and I see I made mistake changing wrong file, I will correct/test it right away:wink:

2 Feb 2010, 1:00 PM
#1164
adi2009 avatar

adi2009

New Zenner

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

Re: Categories Dressing

first, sorry for little delay with post, I was exhausted last night after working on my site all day:shocking::smile: I didnt fully read help files so this morning I read it all, set up my categories_dressing_defines.php file and also css and its working/looks great! Thanks Glenn you rock:clap:

However, I have one more thing to workout: I need one more sidebox on rightcolumn which will have display-limiting set to '0|5|4' (becuse my clients wants this option). I am not sure how to acomplish this, is there some Addon which could be helpful, or should I somehow make copy of original categories sidebox and use that copy to put it in right column?

2 Feb 2010, 3:01 PM
#1165
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

That second categories box is going to be the interesting one. Using different settings for each box will require some cloned and renamed code, and a test to decide which to use in a given situation. It can be done, but will take a bit of work. I'll look at it to get a sense of the best route.

2 Feb 2010, 6:25 PM
#1166
adi2009 avatar

adi2009

New Zenner

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

Re: Categories Dressing

OK Glenn. This is why my client exactly wants that additional sidebox in right column:

Example Link

You will notice right "sidebox" named Parts, which is showing type of spare parts (engine, brakes, suspension...) for current selected model, so user can easly switch for exam. from Engine Parts to Suspension for his car model.

ps. Example link takes time to open, but site is working:bigups:

2 Feb 2010, 9:08 PM
#1167
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

After looking at the Milner site, I have thought of a simple way to get the desired categories boxes/levels.

1: Set the active/level filter to show all first level subcats (as it is now) plus the lower subcats of the active main cat. (It may take a customized version of the active/level managing function - not a big deal.)
2: Activate both the chcategories sidebox as is, and the categories sidebox on the right.
3: Make stylesheet rules that will hide lower subcats in the chcategories box and first level cats in the categories box.

5 Feb 2010, 12:29 AM
#1168
zubenubi avatar

zubenubi

New Zenner

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

Re: Categories Dressing

Hey there,

What are the css commands that can be given to a group to style it? For example in my style sheet I have:

ul#catGroup6_8 {
border: 1px solid #ff0505;
background-color:#000099;
background-image:url(../images/DeliveryVan.gif);
margin-left:20px;
margin-bottom:25px;
height:200px;
}

of the above only the border and height actually do as they are told. I've messed about with padding, margins, bg colors etc (altho fontsize and width also work). Is there a limit to what types of commands you can make a group do? Or am I missing something. It is late after all...

Great mod btw, hadn't realised how unflexable the default zencart cat sidebox was!

5 Feb 2010, 1:27 AM
#1169
berserker avatar

berserker

Totally Zenned

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

Re: Categories Dressing

Hello,

Is this module compatible with HideCategories?

Thanks

5 Feb 2010, 2:07 AM
#1170
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

See posts 1136 and 1137 in this thread.

5 Feb 2010, 2:27 AM
#1171
berserker avatar

berserker

Totally Zenned

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

Re: Categories Dressing

Sorry, forgot that I had already made a post.
That file exist in the hideCategories module. How do I merge them?

Thanks

5 Feb 2010, 2:39 AM
#1172
berserker avatar

berserker

Totally Zenned

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

Re: Categories Dressing

Im getting the HideCategories to work but all the Individual Category Headings has disappeared.

5 Feb 2010, 2:51 AM
#1173
berserker avatar

berserker

Totally Zenned

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

Re: Categories Dressing

Got it to work now :)

5 Feb 2010, 3:04 AM
#1174
berserker avatar

berserker

Totally Zenned

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

Re: Categories Dressing

Is it possible to enter any links and have it displayed in the Categories Sidebox? For example, add a link to Privacy Notice and have that display at the bottom of the Categories Sidebox?

5 Feb 2010, 6:25 AM
#1175
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

You could add that as a heading for one of the links at the bottom of the sidebox, styled to look like another link.
Alternatively, you could edit tpl_categories.php and put the link code there to get it at the very bottom of the sidebox.

5 Feb 2010, 10:40 AM
#1176
adi2009 avatar

adi2009

New Zenner

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

Re: Categories Dressing

gjh42:

After looking at the Milner site, I have thought of a simple way to get the desired categories boxes/levels.

1: Set the active/level filter to show all first level subcats (as it is now) plus the lower subcats of the active main cat. (It may take a customized version of the active/level managing function - not a big deal.)
2: Activate both the chcategories sidebox as is, and the categories sidebox on the right.
3: Make stylesheet rules that will hide lower subcats in the chcategories box and first level cats in the categories box.

sorry for delay in reply again, I had to make necessary changes on site design in meantime, on my client suggestion:bigups:

I forgot to menition that sidebox I set-up on left side on my page is classic categories.php (which is now showing only 1st level subcategories). So I dont know if that changes situation to-much beside left/right position :huh:

2: Activate both the chcategories sidebox as is, and the categories sidebox on the right.

This I have finished, with note that categories.php (which is showing Car Brands) is on left and chcategories.php (which is showing Car Part Type) is in the right column

3: Make stylesheet rules that will hide lower subcats in the chcategories box and first level cats in the categories box.
This is part I having trouble with.. In "categories_dressing_defines.php" display level looks like this:

"define('CAT_BOX_ACTIVE_LEVEL', '0|1|1');"

and that OK regarding left sidebox categories.php, but how can I set chcategories to display level '0|5|4' at same time?
And also I dont understand part about stylesheet rules which will hide lower subcats in the chcategories?

5 Feb 2010, 12:41 PM
#1177
berserker avatar

berserker

Totally Zenned

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

Re: Categories Dressing

gjh42:

You could add that as a heading for one of the links at the bottom of the sidebox, styled to look like another link.
Alternatively, you could edit tpl_categories.php and put the link code there to get it at the very bottom of the sidebox.

Apart from hard-coding it in the tpl_categories.php, is there other way to have a group of links (around 10 manufacturer links) to show as a category sidebox without creating the folders in admin?

Thanks

5 Feb 2010, 1:53 PM
#1178
zubenubi avatar

zubenubi

New Zenner

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

Re: Categories Dressing

Is it not possible to have margins or padding or have a background image set in a ul#catGroup?

I can make borders, adjust fonts, set the height and width of the group but I can't position anything properly :(

At least if I knew it wasn't possible I could give up trying and have a go at something else.

5 Feb 2010, 4:09 PM
#1179
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

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.
5 Feb 2010, 4:11 PM
#1180
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

zubenubi - All of the styling you want should be possible. Post a link to see your site so I can advise.