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.