In /includes/templates/your_template/sideboxes/tpl_categories.php, the categories display list is built with a for loop starting about line 14:
for ($i=0;$i<sizeof($box_categories_array);$i++) {
There are a lot of if tests inside this to determine characteristics of the display, and a switch which is intended to customize individual category line appearance. This switch code can be used in another if test as I did:
//lay a separator between collections and types - gjh42 20070222
if ($box_categories_array[$i]['path'] == 'cPath=81') {
$content .= '<hr id="catBoxDivider2" />' . "\n";
}
You can use this test immediately after the for loop start (say line 15) with its closing } just before the
}
if (SHOW_CATEGORIES_BOX_SPECIALS == 'true' or...
around line 59. This will evaluate whether or not the category should be displayed before determining how to display it.
For your purpose, I suggest something like this (replacing the cPaths with yours):
PHP Code:
for ($i=0;$i<sizeof($box_categories_array);$i++) {
/* test for cats to display */
if ($box_categories_array[$i]['path'] ==('cPath=3' or 'cPath=7' or 'cPath=7_25' or 'cPath=7_26' or 'cPath=12')) {
/* many lines of existing code */
} /* add this */
}
if (SHOW_CATEGORIES_BOX_SPECIALS == 'true' or...
If the cPath being evaluated is not in this list, it will not be displayed in this sidebox. For the simplest use, it will be necessary to mention every subcategory cPath as well as top cats.
If you have a lot of subcats this could get cumbersome. In this case it will be possible to evaluate for just the topcat id, but will be more complicated. The way I did it for another purpose won't exactly work here, and I would have to think a while to figure a good way to do it.
Let me know how this works for you.
Bookmarks