Black Belt
- Join Date:
- Jul 2005
- Location:
- Upstate NY
- Posts:
- 21,876
- Plugin Contributions:
- 8
Categories Dressing
You would need to have the chcategories option installed to get the whole active subcat tree.
Views: 531,618
Black Belt
You would need to have the chcategories option installed to get the whole active subcat tree.
Black Belt
Boggled - Since each subcat group belonging to a particular top cat will have its own group id, you can address that specifically to not fly out on hover. Seeing it live would let me tell you exactly what rule to use.
Zen Follower
gjh42:
Boggled - Since each subcat group belonging to a particular top cat will have its own group id, you can address that specifically to not fly out on hover. Seeing it live would let me tell you exactly what rule to use.
Thanks for helping Glenn!
Here is the site: http://abikergear.com
Right now, both the header I set up (unlinked) and the actual category are both showing. (Motorcycle Helmets)
Edited to add...
I want to do the same thing with the other 'headers' too, but they don't have a category set up yet - Motorcycle Apparel, Motorcycle Accessories, Shop by Brand (that one is set up).
Black Belt
Add to the bottom of your stylesheet_chcategories_dressing.css
#chcategories #catGroup1_72 {display: none;}
Also, you should not have stylesheet_categories_dressing.css in your folder when you are using chcategories; some of the rules might conflict, and it is not needed in any case.
Zen Follower
gjh42:
Add to the bottom of your stylesheet_chcategories_dressing.css
#chcategories #catGroup1_72 {display: none;}
Also, you should not have stylesheet_categories_dressing.css in your folder when you are using chcategories; some of the rules might conflict, and it is not needed in any case.
Thank you!
I'm going to try it out right now. :)
Thanks for the heads up on the other stylesheet too. I didn't know if I needed it or not.
Totally Zenned
Hello,
Installed ch_categories and it is exactly what we need. Only problem is that we need the main categories to display on the main page and only show the sub sub categories for when a main category is clicked. Any help on how to set that up?
Also, are there other files from Categories Dressing that is not required when using CH Categories apart from stylesheet_categories_dressing.css?
Thanks
Zen Follower
One other quick question...
Is there a way to style the flyout so that it will be fluid and auto adjust the width to match the subcat name?
I don't like the way it looks when a name wraps around to a second line, but don't want to make them all super wide.
Black Belt
These rules will give auto subcat width with no line wrapping:```
#chcategories ul ul {display: none;}
#chcategories li:hover {position: relative;}
#chcategories li:hover>ul {
display: block;
position: absolute;
left: 100%;
top: 0;
z-index: 100;
width: auto;
white-space: nowrap;
}
Zen Follower
Again, thank you so much for all your help, Glenn!
Everything is working perfect now. :smile:
Black Belt
Berserker - The stylesheet is the only file that is duplicated. Ch_categories itself only adds two new files, a class and a module file, and uses the stock tpl_categories.php (or whatever is there in place of it).
To understand your requirements, you want top cats only on the home page? Or top and first level subcats? And all sub-subs also when a top cat is active? How about on pages not Home and not category/product (like ez-pages)?
Totally Zenned
Hello,
We only need the top cats on the homepage and pages that are not category/product.
We have quite a lot of subs and sub-subs so having ch_categories to show on the main page makes the page a bit too long.
I tried to play around with it yesterday by having the original "categories" sidebox to show the top cats on homepage and then the "ch_categories" sidebox when a category is selected but couldnt get them to work separately.
I'll send you the link to the site to check.
Thanks
Black Belt
In categories_dressing_functions.php, add a new case to the switch in function cat_active_level_manage($path):```php
//alternate case for Berserker 20110207
//The main categories are already set up with all the subs and sub-subs using ch_categories.
//Just need to be able to show on the top cats on homepage and pages that are not category or product.
case 6://full tree (only all tops when no cat selected)
if($cPath_top == 0) $test_level = 1;
break;
Then set the parameters:```php
define('CAT_BOX_ACTIVE_LEVEL', '6|0|0');//show only top cats when no cat selected
Alternatively, adding the flyout rules would get the sidebox compact on all pages.
Black Belt
By the way, if you only want the currently selected top cat to fully expand, you can use the built-in case 3, and set the define like this:```php
define('CAT_BOX_ACTIVE_LEVEL', '3|0|0');//full active tree; only top cats when no cat selected
Totally Zenned
Hello,
Tried both settings and case 3 is the best to what we need. But how can I stop the other top categories from displaying when a category is selected? You can check the site for the changes made.
Thanks
Black Belt
You didn't say that you wanted that - try the built-in case 2:```php
case 2://active only (per level when no cat selected)
if($cPath_top == 0){//test
$test_level = 1;
break;
}
if($cPath_top != $path_top) $skip_cat = 1;
break;
define('CAT_BOX_ACTIVE_LEVEL', '2|0|0');//full active tree only; only top cats when no cat selected
If what you want is to have no top cats showing when one is selected, you could modify case 2:```php
case 2://active only, without top (per level when no cat selected)
if($cPath_top == 0){//test
$test_level = 1;
break;
}
if($cPath_top != $path_top or $path == $path_top) $skip_cat = 1;
break;
Totally Zenned
Hello,
AWESOME!!!!! The following code does it:
case 2://active only (per level when no cat selected)
if($cPath_top == 0){//test
$test_level = 1;
break;
}
if($cPath_top != $path_top) $skip_cat = 1;
break;
The code below did not work though but does not matter :)
case 2://active only, without top (per level when no cat selected)
if($cPath_top == 0){//test
$test_level = 1;
break;
}
if($cPath_top != $path_top or $path == $path_top) $skip_cat = 1;
break;
Thank you so much for taking the time to help! Much appreciated!
Must say, you have some of the best mods here. Also using EZ Pages Footer Columns and Model List.
Thanks again!!! :)
New Zenner
Hello Glen, and everyone else. I've googled away and searched upon searched, and feel like this question has been asked, but maybe not with regards to this mod (which is awesome btw).
I want to completely eliminate my navBreadCrumbs bar, but the only way this makes sense for me to do is if people can still know where they are. I've found out how to highlight active subcategories, and have done this on my local server by using the following lines -
/change bullet when a category w/o bg image is open to products:/
#categories li a.cat-selected-text {
color:#990033;
}
My subcats locally have no background images, so this is pretty obvious.
My main concern is a way to keep the current category with a different or highlighted image button. here's my site (currently no subcats) -
http://www.niqfashion.com/theshop
Each category is in its own group per the defines file, and each has its own image and hover property per the css file. Is it possible to keep that hover image ON when that category is selected?
Thanks,
Nick
Black Belt
Add the selector in red if you want to use the hover state for the selected state.
Add the rule in green instead if you want to use a different image.```
#categories li a.catBg2 {
background-image: url(../buttons/english/catbg2.gif);
height: 30px;
}
#categories li a.catBg2:hover, #categories li a.cat-selected.catBg2 {
background-image: url(../buttons/english/catbg2hover.gif);
background-repeat:no-repeat;
}
#categories li a.cat-selected.catBg2 {
background-image: url(../buttons/english/catbg2selected.gif);
background-repeat:no-repeat;
}
New Zenner
awesome, thanks so much!
I was trying
categories li a.catBg1:active, and then
categories li a.catBg1:selected
:S But what you wrote worked perfectly. Guess I shoulda interpreted it from the Subcats code in the css file...
Thank you!
Black Belt
Note: the :active pseudo-class does not mean "current page link", but refers to the link state after being clicked and before the page refreshes. This used to be a noticeable lag (and an indication that something was actually happening was useful), but it is mostly irrelevant now with faster connections and computers.
Fields marked required must be completed.
Tell staff why this post should be reviewed.