how would I make the categories expand when the site loads?
Printable View
how would I make the categories expand when the site loads?
This is found under Tools/Configuration/Layout Settings :
Categories - Always Open to Show SubCategories
Always Show Categories and SubCategories
0= off, just show Top Categories
1= on, Always show Categories and SubCategories when selected
Thanks
This works only when selected
is there a way to show all subcategories on page load so I don't have to click it to expend
Hi,
I've been searching for a contribution with this functionality for quite a while and it seems like i'm not the only one.
Most of the suggestions refers to dead links but eventually was able to locate a working contrib (even though there's a slightly annoying bug).
Just a suggestion to the ZC Team....
> This is found under Tools/Configuration/Layout Settings :
> Categories - Always Open to Show SubCategories
> Always Show Categories and SubCategories
> 0= off, just show Top Categories
> 1= on, Always show Categories and SubCategories when selected
Wouldn't it be useful and logical to have an extra option switch which displayed the categories fully expanded?
i.e.
2= on, show both Top Categories & Subcategories
Maybe the ZC Team can add this option in future upgrades (v1.3.x) or at least in v1.4 with the Modified PO Tree Traversal changes.
Thnx.
YM.
There is a recent topic about this.
Expanding the categories
Also another
Categories Menu, YahooTreeMenu With AJAX
Think that they can be all expanded with some code change, try it yourself.
.
Let me say as the author of the YahooTreeMenu With AJAX contribution. :)Quote:
Originally Posted by seethrou
I have made this menu without AJAX before this one with AJAX. I had not it published. :)
You can found it here:
http://zen-cart.org.ua/download/yaho...1.2.7_0.1b.zip
This one generates complete menu tree, not only top level and selected branch.
If you call expandAll() method of the tree object right before tree.draw() the TreeMenu will be expanded. :) (http://developer.yahoo.com/yui/docs/...html#expandAll)
Andrew.
how do i make my ajax menu to stay expandable
So has anyone solved this one? How do I make the AJAX version have the subcategories expanded upon the load of the main page?
Are you set on using this particular "AJAX" mod? Or do you just want the categories expanded? There are several more recent expanded categories mods; the one I have heard the most good reports about is fragfutter's Uncollapsed Categories Tree, available from his site and referenced in the forum thread of the same name.
My main issue with his and the default categories is that they are so ugly.
AJAX one is very pretty, but alas I have no idea how to make it expanded by default.
What is inherently ugly about them? You can change anything you like about the appearance with CSS in the stylesheet. Categories Dressing gives almost infinite flexibility, but only applies to the standard sidebox.
How does the AJAX sidebox look different?
Dynamic as in only the top cats show, and when you mouse over one it scrolls down to show its subs? That's something that I think you need js for - the CSS flyout menu doesn't scroll down in a column. The arrows can be added to any category box with CSS.
The thing is - I am not a programmer, so I use pre-canned stuff. I don't know half the things you just said. All I know is that I need a menu that displays all subcats to begin with and doesn't have all the ugly ASCII pipes and underscores for dir branches.
Those pipes and underscores are editable in admin > Configuration > Layout Settings.
And yes, I think they're ugly too.
Do you want the subcats always showing? Then the Uncollapsed Categories Tree can be styled to look however you want. I can advise if you need help there.
Sorry for ignorance, but I can put nicer image-based branches in there using the admin interface, and make sure the long cat names don't wrap to start at the next line without the indent?
The wrapping is not controllable in the standard admin interface. It could be handled to some degree with CSS - it would depend on exactly what layout you wanted.
It may be possible to use an image for the categories subcategories separator in admin - I haven't tried it, but HTML works there, so it should be ok.
Same here, how do you make all subcats expanded by default?
i found something.
http://www.zen-cart.com/forum/showthread.php?t=67717
I have heard good reports about fragfutter's Uncollapsed Categories Tree mod. Search the forum for the thread with the link to his site.
Ok, so this is the Expanded Categories List mod. Question is, could it coexist with the Categories Dressing mod?
Limelites and I have just made the discovery that fragfutter's Uncollapsed Categories Tree is completely compatible with Categories Dressing, with one small tweak to the stylesheet (change all #categories selectors to #chcategories). I will be releasing a new version of Cat Dressing which optionally bundles the two mods, or you can download them separately now and make the tweak yourself (it's really very easy).
Hmm, installed both, as soon as I change all instances of #categories to #chcategories, all my pretty default images for bullets get swapped for the regular o's and it's still not uncollapsed.
See images (I uncollapsed the first cat manually in those examples to show the change in bullets.)
Bump? Anybody out there?
Hmm, I thought I had replied to your previous post. Maybe it was late at night and I missed actually posting the reply.
Did you turn on the chcategories sidebox in Tools > Layout Boxes Controller?
Can you give a link to see what your site is doing? It sounds like the mod stylesheet is not being applied where you want it, but I can't say more without seeing it.
The stylesheet_categories_dressing.css that is active in your template does not have the chcategories modifications, so that is why it is not working.
You need to change all
#categories
to
#chcategories
in that file.
Figured out what my problem was. I initially changed #categories
to #chcategories, but was expecting the changes to be made to the "Categories box", not the "Categories_List" box, which I didn't even have enabled at the time. By the time I had it re-enabled, I had gone back to #categories.
I think you need to make it more clear as to which box needs to be enabled. :)
Oh, believe me I AM thankful!!! Glen, you rock, man!
Just spell my name correctly and I'll be happy ;)
So no one has figured out a way to uncollapse the subcatagories to the first level of subcatagories only I take it?
Thanks, Tim.
Categories Dressing with its Uncollapsed Categories option can be set to display pretty much any rational set of categories, including top & first subs only.
That's great i've downloaded and installed it but find it a bit confusing.
Any possiblity you could explain how to do just that?
Thanks, Tim.
I thought this would do it
But this shows all subcvats rather than just to the 1st levelCode:define('CAT_BOX_ACTIVE_LEVEL', '2|0|1');
There is a bit of ommission in the comments for that.
//active: 0=all tops/
should say
//active: 0=all cats, level control/
as that setting lets the level controls apply equally to all categories.
So you would useI think it was left over from when the mod didn't apply to expanded categories, so "all tops" was the only possibility. It is fixed for the next version of Cat Dressing, to be released as soon as I finish final testing.PHP Code:
define('CAT_BOX_ACTIVE_LEVEL', '0|0|1');
Thanks again. That has solved the more than 1 subcat opening, but now it doesn't open even when you click on the subcat. There is no way around that?
Sorry for being a pain.
You didn't say that you wanted active sub-subcats to show in the sidebox. Some people don't. In that case, you would use setting 4:
//3=full active tree, others per level/4=like 3, active branches only
If you want something different yet, other criteria can be coded in and the define choices extended.PHP Code:
define('CAT_BOX_ACTIVE_LEVEL', '4|0|1');
That's fantastic. Thanks for your help.
One last option would be great. That if you click on a catagory or subcatagory, that catagory or the catagory that the subcat belongs to if the only one showing in the catagories box with a single "view all catagories" link at the very top to bring someone back to show all catagories.
I hope I make sense. I take it that's not possible yet?
It couldn't be achieved with the current available settings alone.
Switching from a "top + first subs" view when no cats have been clicked to some variety of "active tree only" view when a cat is active could be done in categories_dressing_defines.php by adding another case with appropriate coding to the cat_active_level_manage() function.
Getting the "view all" button when a cat is active would be trickier, and I would have to think about the best way to do that.
This may do the control you want. I have not tested it; try it and let me know if there is a problem.PHP Code:
case 6://like 4, per level when none active
if($cPath_top == 0){
$test_level = 1;
break;
}
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
$skip_cat = 1;
}
break;
Thanks again. Where would I add this? I'm sure it's obvious but I know nothing about php.
Tim.
OK, edit /includes/functions/extra_functions/categories_dressing_functions.php, and add it after the "case 5" code block.Then edit the define with '6|0|1'.PHP Code:
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;
case 6://like 4, per level when none active
if($cPath_top == 0){
$test_level = 1;
break;
}
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
$skip_cat = 1;
}
break;
}//switch
It works perfectly. Amazing, thank you!
Glad it's working. Would you mind letting me see the site?
It's not a live site as you can see. There is still alot of work to be done and I have yet to change the colors in the menu. On that, is it possible to change the background color of a subcat only when it is active?
The right hand menu is also just temporary.
http://www.lowpricedhardware.ie/
You can highlight the current category path with these selectors (already in your stylesheet_chcategories_dressing.css):
#chcategories li a.cat-selected-text {}
#chcategories li a.cat-parent-text {}
Thanks yet again.
I'm sure I'm missing something very obvious but how do I change the font, and background color of the main cat headings? And the backgund color of the subcats?
I still havn't figured out how to change the font of just the top catagories.
looking at the code that is outputted,
Code:<li class="cat-top"><a class="cat-not-selected-text" href="http://lowpricedhardware.ie/index.php?main_page=index&cPath=2374">CAMERAS</a>
<ul id="catGroup2374_2439">
<li class="cat-subs"><a class="cat-not-selected-text" href="http://lowpricedhardware.ie/index.php?main_page=index&cPath=2374_2439">Accessories</a></li>
<li class="cat-subs"><a class="cat-not-selected-text" href="http://lowpricedhardware.ie/index.php?main_page=index&cPath=2374_2446">Camera Lenses</a></li>
<li class="cat-subs"><a class="cat-not-selected-text" href="http://lowpricedhardware.ie/index.php?main_page=index&cPath=2374_2375">Digital camera</a></li>
<li class="cat-subs"><a class="cat-not-selected-text" href="http://lowpricedhardware.ie/index.php?main_page=index&cPath=2374_2461">Digital photo frame</a></li>
<li class="cat-subs"><a class="cat-not-selected-text" href="http://lowpricedhardware.ie/index.php?main_page=index&cPath=2374_2597">Flash</a></li>
<li class="cat-subs"><a class="cat-not-selected-text" href="http://lowpricedhardware.ie/index.php?main_page=index&cPath=2374_2523">Memory cards</a></li>
The first li doesn't seem to be closed?
so the sub cats get their style from the firstCode:<li class="cat-top"><a class="cat-not-selected-text" href="http://lowpricedhardware.ie/index.php?main_page=index&cPath=2374">CAMERAS</a>
<ul id="catGroup2374_2439">
<li class="cat-subs">
?Code:<li class="cat-top">
The first <li> in your snippet encloses the whole subcat list. This is a discussion better continued in the Categories Dressing support thread.
In general, you style outer or generic elements, and then style inner or more specific elements if you want them different.
Ok thanks again for all your help. It's very appriciated.
One thing I'm still trying to figure out is how to make a link at the top of the catagories that replaces the "catagories" text when on anything other than the main page that says something like "browse all catagories" or something like that.
You can add an HTML link to each category description for that. Just copy the same bit into each category.
Thanks again. One final configuration would make things pretty much perfect, but is probably not possible.
But, would it be possible for say to have all the categories explanded to the first subcat level. But when anyone clicks on the link of a cat. or subcat, for that whole cat and subcat to move to the top of the cats/subcats......as if it's sort order was 1 and the rest were higher than that, until they click on a cat/subcat of one of the other cats, which would then move to the top..
I'm not sure that's a good idea, moving items around in the menu so the order is not consistent.
Since there is a class tag for the current category, it would be possible to use absolute and relative positioning on various elements and make a selected category move to the top of its parent's subcat list. That would probably require leaving a blank space at the top when no subcat has been selected, as you can't style an element based on conditions of a child element.