-
Re: Categories Dressing
If there is a method you can use to distinguish between subcats you want in different colors, you can replace the selection code ($box_categories_array[$i]['path'] == 'cPath=3_42') with that.
I can't be any more specific without knowing exactly how you want to change colors.
You say "1000 products", but how many subcats do you have?
You don't need to specify every subcat; make a spec that covers them generally, and then specify the exceptions with the code above...
-
Re: Categories Dressing
I have 17 categories and there are 17 subcats inside so..i need only this 17 subcats to have diferent.
Categorie 1 green(picture)...subcategories will be GREEN
Categorie 2 blue(picture)...subcategorie will be BLUE
etc.
Thank U for you interest!
-
Re: Categories Dressing
So are there 17 different colors you want for subcats? And if you have 17 top cats and 17 subcats, how many subcats are in each topcat?
-
Re: Categories Dressing
I have 17 TOPcat and they have lots of subcategories.
For example TOPcat ONE has 2 subcategories which all of them I need to have green.
TOPcat TWO has only products inside (40 products) - this background colour I need to have blue
TOPcat THREE has 7 subcategories which I need to have Black...etc etc.
Simply said...I need to have every subcategory the same colour as have its TOPcategorie.
http://img159.imageshack.us/img159/1...een1kc7.th.jpg
-
Re: Categories Dressing
OK then, a filter for subs of a particular topcat will do the trick. Give me a few minutes.
-
Re: Categories Dressing
I couldn't locate the exampe I had previously worked out like this, so had to redo it...
You will modify this section of tpl_categories.php:
PHP Code:
for ($i=0;$i<sizeof($box_categories_array);$i++) {
switch(true) {
// to make a specific category stand out define a new class in the stylesheet example: A.category-holiday
// uncomment the select below and set the cPath=3 to the cPath= your_categories_id
// many variations of this can be done
// case ($box_categories_array[$i]['path'] == 'cPath=3'):
// $new_style = 'category-holiday';
// break;
case ($box_categories_array[$i]['top'] == 'true'):
$new_style = 'category-top';
break;
case ($box_categories_array[$i]['has_sub_cat']):
$new_style = 'category-subs';
break;
default:
$new_style = 'category-products';
}
This code will return just the top category id for whatever the current cat is:
PHP Code:
$current_top = str_replace(strstr("_",$box_categories_array[$i]['path']),"",str_replace("cPath=","",$box_categories_array[$i]['path']));
Insert this between the "for" and "switch" statements.
PHP Code:
case ($current_top == '3'):
$new_style = 'category-subof3';
break;
Insert one of these for each top cat you wish to distinguish, in the spot noted. They must be in exactly this location to work correctly.
PHP Code:
for ($i=0;$i<sizeof($box_categories_array);$i++) {
$current_top = str_replace(strstr("_",$box_categories_array[$i]['path']),"",str_replace("cPath=","",$box_categories_array[$i]['path']));
switch(true) {
// to make a specific category stand out define a new class in the stylesheet example: A.category-holiday
// uncomment the select below and set the cPath=3 to the cPath= your_categories_id
// many variations of this can be done
// case ($box_categories_array[$i]['path'] == 'cPath=3'):
// $new_style = 'category-holiday';
// break;
case ($box_categories_array[$i]['top'] == 'true'):
$new_style = 'category-top';
break;
/* add all individual subcat cases here*/
case ($current_top == '3'):
$new_style = 'category-subof3';
break;
case ($box_categories_array[$i]['has_sub_cat']):
$new_style = 'category-subs';
break;
default:
$new_style = 'category-products';
}
Style these like
a.category-subof3-text {background-color: #112233;}
a.category-subof4-text {background-color: #223344;}
-
Re: Categories Dressing
Erratum: the strstr() function is laid out differently from the functions I am used to, so the $current_top statement will need to be changed to this:
PHP Code:
$current_top = str_replace(strstr($box_categories_array[$i]['path'],"_"),"",str_replace("cPath=","",$box_categories_array[$i]['path']));
I have not tested this whole setup, and it is possible that strstr() may cause an error in top cats. This error may or may not matter in execution; please post with any results, and I will debug if needed.
-
Re: Categories Dressing
I don't know how to say it but....YOU ARE GENIUS :bigups:
Oh man...I am so happy! You helped a lot!
-
Re: Categories Dressing
I was wondering if you were limited by button size to the size of the sample buttons or can you use any size buttons you want to use?
-
Re: Categories Dressing
Category and heading images can be any size you want.
Be careful not to make them wider than the column/sidebox width is set for, *accounting for padding/margins*.
If you are using background images, you will of course have to specify the element width and height in the stylesheet, as the background does not take up space by itself.