Thanks so much!!!
We're still using .catBoxHeading3. Deleted .catBoxHeadingImg.
Thanks again for this awesome mod!!!
Printable View
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"
and this part of code I have insert in "stylesheet_categories_dressing.css"Code:#chcategories ul ul ul {/*hide all deeper than first subcategory lists - left box*/
display: none;
}
3. I have added /case 7/ successfully in "categories_dressing_functions.php" and used define setting of '7|4|5'Code:#categoriesContent>ul>li>ul>li>a {/*hide only first level subcategories - right box*/
display: none;
}
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 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.
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 7It should output some numbers in the category boxes like first: 147_199. Let me know when you have applied this, and I will look at it to see what it does.PHP Code:
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;
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:
and now its not shows paths, is this OK?Code: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;
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!
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.
OK Glenn:bigups:
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
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.
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:If this still does not work, you may need more specificity. Add #categories in front of the ul, like this:Code:/*example for custom category group styling*/
ul#catGroup3 {
#categories ul#catGroup6_8 {
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