Alex,
I'm trying to port the side-bar mod over, and enhance it with a feature to expand the local sub-categories (now that we can find them).
Is there a way to make a simple call to get a list of the top level categories, then the subcategories at the current level?
I'm trying for something like:
Top_Level_2
Second_Level_1
Second_Level_2
Third_Level_1
Third_Level_2
Third_Level_3
Third_Level_4
Third_Level_5
Third_Level_6
Third_Level_7
Third_Level_8
Second_Level_3
Top_Level_3
Top_Level_4I figure if you know what level you are at, you can backtrack and get the path up to the top (or parse out the Full Name from the category table).
I would expect the _max_ depth in this 0-based field would be 3 (4 levels)
and there would only be up to 20 categories at any level. I'm not trying to make a solution to handle DMOZ <G>
Also, because this is something that would not change very often, it could be written out to a series of files that can be <%include category_sidebar_level%> since even 20x20 is only 400. The speed benefit far outweighs the diskspace.
This would make a perfect plug-in, with a single admin option to re-generate the level files, and perhaps some user options to customize the display (as well as the ability to edit the template via the regular editor).
I really need this, so one way or another I've got to fgiure it out, and it would make a cool little plug-in.
The subroutines to grab_top_level_categories, grab_current_level_categories, and grab_path_from_top would be great widgets in their own right, but something like that already exists... I just can't figure out how to call it.
Also, there are ways to make this dynamic, using partial templates, and partial look-ups, that could cut out the 'leaf' files, by pre-generating the various category template files, and then only selecting out and high-lighting the "leaf" category you are currently in. These fall under pwerformance tweaks, but I need a pointer on the best way to grab the categories at a given level.
PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://postcards.com/FAQ
I'm trying to port the side-bar mod over, and enhance it with a feature to expand the local sub-categories (now that we can find them).
Is there a way to make a simple call to get a list of the top level categories, then the subcategories at the current level?
I'm trying for something like:
Code:
Top_Level_1 Top_Level_2
Second_Level_1
Second_Level_2
Third_Level_1
Third_Level_2
Third_Level_3
Third_Level_4
Third_Level_5
Third_Level_6
Third_Level_7
Third_Level_8
Second_Level_3
Top_Level_3
Top_Level_4
I would expect the _max_ depth in this 0-based field would be 3 (4 levels)
and there would only be up to 20 categories at any level. I'm not trying to make a solution to handle DMOZ <G>
Also, because this is something that would not change very often, it could be written out to a series of files that can be <%include category_sidebar_level%> since even 20x20 is only 400. The speed benefit far outweighs the diskspace.
This would make a perfect plug-in, with a single admin option to re-generate the level files, and perhaps some user options to customize the display (as well as the ability to edit the template via the regular editor).
I really need this, so one way or another I've got to fgiure it out, and it would make a cool little plug-in.
The subroutines to grab_top_level_categories, grab_current_level_categories, and grab_path_from_top would be great widgets in their own right, but something like that already exists... I just can't figure out how to call it.
Also, there are ways to make this dynamic, using partial templates, and partial look-ups, that could cut out the 'leaf' files, by pre-generating the various category template files, and then only selecting out and high-lighting the "leaf" category you are currently in. These fall under pwerformance tweaks, but I need a pointer on the best way to grab the categories at a given level.
PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://postcards.com/FAQ