Parent Categories Separated In 3 sideboxes
hi everyone im hoping this can be done and easily. i have been searching for a while but have come up with nothing. i found one older post about this but there were no answers so i figured i would give it a shot. i would like to have three category sideboxes one for adults, children and teens. and in each of these side boxes i would like to have the appropriate categories.
is this possible?
thanks for looking
Re: Parent Categories Separated In 3 sideboxes
Easy is a nebulous term??? You would need to clone/duplicate the /includes/modules/sideboxes/categories.php and the associated /includes/templates/template_default/sideboxes/tpl_categories.php files along with the names files etc and edit these to only display the category that you want and be titled as you want.
This should all be accomplished using the override system to preserve your hard work.
Re: Parent Categories Separated In 3 sideboxes
perfect, thanks so much i should be able to do that*L* i have cloned other files so it should not be to hard. appreciate the reply
Re: Parent Categories Separated In 3 sideboxes
sorry one more question ..... i duplicated the sideboxes just fine but how do i specify which category to show in which sidebox?
Re: Parent Categories Separated In 3 sideboxes
Duping the boxes is the easy part - defining what needs to be in the box on a dynamic basis becomes a bit more complicated and I have not done this as you are trying to but...
/includes/functions/functions_categories.php I believe is what populates this box
but it mat be the tpl that grabs this and can be adjusted most simply
Re: Parent Categories Separated In 3 sideboxes
thanks alot i will give it a go, im sure i will figure it out
i appreciate the help
cara
Re: Parent Categories Separated In 3 sideboxes
ok so i think i got myself into more then i can handle*L*.
i though this would be easier, but i think im going to have to do to much coding to figure this out and im just not good enough with php to do that. im going to look at this a little more but from what i saw in functions_categories.php it looks pretty hard.
if you or anyone has an advice or thoughts on how to go about this they will be of great help, in the mean time im going to see what i can do.
thanks again
Re: Parent Categories Separated In 3 sideboxes
I did a mod to insert another breakline between some of my categories, checking the category id to put it in the right place. You could do a similar thing, screening the current cat being added against a list and skipping it if it is not on the list. This would require editing the code if you add any categories, but it wouldn't be difficult.
I am away from my regular computer so can't give any more info at the moment, but if you still need help I can post later tonoght. (The file wasn't in /functions, but I can't remember which one it was right now.)
Re: Parent Categories Separated In 3 sideboxes
if you have the time i would love some help later, im going to work on it now for a while and see if i can figure anything out. but i would defiantly appreciate some more info if you dont mind.
thanks so much for you help
Re: Parent Categories Separated In 3 sideboxes
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.