-
Re: Categories Dressing
Your example is a very complex and custom-built categories menu group.
You could achieve the basic functionality of showing only the active branches of the active tree by modifying case 4 in categories_dressing_functions.php. Call it case 7:
PHP Code:
case 7://like 3, active branches only, no tops, no collateral first subs
if($cPath_top == $path_top){
$path_ids = explode('_',$path);
if ($cat_depth == 0){ $skip_cat = 1; //no top cats
}elseif ($cat_depth ==1){//hide first subcats unless active or none selected
$cpath_depth = substr_count($_GET['cPath'],'_');
$path_current = $path_ids[count($path_ids)-1];
if (!in_array($path_current,explode('_',$_GET['cPath'])) and $cpath_depth >= 1) $skip_cat = 1;//show only subcats w parent in $cPath
}elseif ($cat_depth >= 2){//only test sub-subcats+
$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 {//skip if not in active top
$skip_cat = 1;
}
break;
I'm getting cross-eyed now... time to take a break. Try this and see how it works. Use 7|1|9 in the define. Post a screenshot and description if it isn't what you want yet.
-
Re: Categories Dressing
Man, that's awesome! It works exactly as I want it. Thank you so very much!
Now, I'll just have to figure out how to add a link to all top level categories on top of the sidebox. Been thinking about what you've said and there should be something there, although I have cat tabs. Would you happen to know what code would call for all top level categories listing?
-
Re: Categories Dressing
Glad it's working!
A link for all top cats would be like
<a href="index.php?main_page=index&cPath=0">All Main Categories</a>
There are easy ways to add a link in the Categories Dressing box, but since you have so many different possible displays there, they won't work correctly in every instance. You will need to hard-code it in tpl_categories.php. Find this at the top of the file
PHP Code:
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
and add
$content .= '<a id="topLink" href="index.php?main_page=index&cPath=0">All Main Categories</a>';
to get
PHP Code:
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
$content .= '<a id="topLink" href="index.php?main_page=index&cPath=0">All Main Categories</a>';
Then add to your stylesheet
#chcategories #topLink {}
with any styling you need.
Change the All Main Categories text as desired.
-
Re: Categories Dressing
Hm... Adding it is not a problem, but it doesn't work with Simple SEO URLs. I did know the direct link (cPath=0), but I've tested it on my other live site which uses SSU and it just took me to the home page (as in page not found). Is there any other way to access all categories (zen_href link) so it works with SSU since I plan on using it on this site...
-
Re: Categories Dressing
You should be able to use zen_href_link() for that... I don't have the exact format you would need off the top of my head.
-
Re: Categories Dressing
Glenn, thank you very much for all your effort and help provided, I really appreciate it. If I find the solution for the zen_href_link and going to top level categories, I'll make sure to post it here.
Once again, thank you.
-
Re: Categories Dressing
At first I was a little overwhelmed by the possibilities of this mod, but now... I just love it :clap:
-
Re: Categories Dressing
Thanks! It can be overkill for some small requirements, but it would have been much more complicated to build a bunch of different small mods that could all work together instead of bundling the whole smorgasbord of options into one mod.
-
Re: Categories Dressing
I'm really sorry if this has already been addressed. I've tried searching, but short of reading all 170+ pages in this forum alone, I'm stuck as to where to go next.
Anyhow, what I'm trying to do is to display one of my groups of categories as inline. In other words, I have categories for each letter, and I'd rather them appear as one block than each on its own line.
I had no problem before I added the categories dressing (simply removed the < br > from the tpl_categories.php for my theme). But now, with Categories Dressing, I can't figure out what to do. It seems that my group is only including the first category in it rather than all 26.
Any thoughts?
Another more specific question: in the categories_dressing_defines.php, does it matter what order the define statements are in? My categories don't appear in numerical order, so my define statements reflect that. ie:
define ('CAT_BOX_HEADING_61','1|0||');
define ('CAT_BOX_HEADING_41','1|0||');
define ('CAT_BOX_HEADING_33','1|0||');
define ('CAT_BOX_HEADING_1','1|0||');
Thanks in advance for the help!
-
Re: Categories Dressing
The order of the defines makes no difference.
You should be able to make your special group of categories inline while the rest display as usual, by setting the first item in each define '1|0||' correctly (to start a new group or not). I can give specific advice if I can see your site live.