Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.2
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

fh_category_list

Created based on some context-based textpattern plugins, this plugin goes recursively based on your current section and look for category names and leaf articles. Attributes incude:


section * lists categories under one section, or the current section
label * text label before the list
wraptag * wraptag enclosing the whole trunk of code
break * text break after each line
class * css class, default as category_menu
category * lists all categories and articles with this parent. Default as current category (root if empty).
list * Non-zero values : include link to articles, default is false

Please be warned that this plugin is for my personal use only so there may be bugs that might not be a problem under my textpattern setting. When in doubt, debug.

Comments are welcome, please send to sanford dot poon @ gmail dot com.

Update 0.2:
* Edited code and SQL queries for performance
* Corrected typos and general styling

Article Request Count:
Initially released:
2005-09-19
Posted here:
23 Sep 2005
Article modified:
02 Nov 2006

Comments/questions? Leave a message in the form.

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Commented (4)

Why don’t you use “GROUP BY” in a single SQL query ? it’s faster than doing lots of queries in a loop. Just look at the source code of my category list plugin, cbs_category_list.
fh:
That’s a good idea but you can’t expect someone who doesn’t know much about SQL to do that as a late night exercise, right? Plus the logic would be more complicated when there are Catagory1 and Catagory2.. Trying to finish it off with 3 lines of SQL.. need to explore a bit more in the next few days.
Christophe Beyls:
Okay :) I know I was a bit rude… I started like you too. So, good exploration! If you have any question, don’t hesitate to contact me.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern