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

cbs_category_list

Description

This simple plugin is basically equivalent to category_list, excepted that it is section-sensitive and only lists article categories.

Categories are displayed using their title and optionally their article count for the selected section and sorted alphabetically by title.

If no article is found in the section for a category, this category will not be shown.

Syntax

<txp:cbs_category_list />

Attributes

Required

none.

Optional

section: The section to display the related article categories. When ‘default’ (the frontpage) is specified, it shows all categories related to sections which are part of the frontpage. Default is the current section.

sticky: When set to true, will display the category list of ‘sticky’ articles instead of ‘live’ articles. Default is false.

posted: Either ‘past’, ‘future’ or ‘all’. Will only count articles with the specified publication date. ‘all’ is slightly faster because MySQL will be able to cache the query. Default is ‘past’.

parent: The parent category name. If specified, will return only the direct children categories for this parent. It will not show children of children. Default is any category.

showcount: When set to true, displays the number of related articles next to each category. Default is false.

label: Label for the top of the list. Default is no label.

labeltag: Independent wraptag for label for the top of the list. Default is empty.

break: HTML tag to be used for line breaks, without brackets. Default is br.

wraptag: HTML tag to be used as the wraptag, without brackets. Default is empty.

class: CSS class attribute for wraptag, default is cbs_category_list.

activeclass: CSS class attribute for the currently active category, if any. By default, the active category is displayed like the other ones.

Important

This plugin only works with Textpattern 4.0.2 and above. Please upgrade if required.

Hi, i can not install the plugin on the german TXP Blog which is running on TXP v. 4.0.1. After inserting the code and hitting the okay button i am directed to the index page of textpattern directory. Usually i do not have any problems installing plugins except for this one and mem_online_users. Both fail the same way.

Yep, I would say the same. Glad you find it useful. I just like small and fast code; if you look at the source you’ll see it’s clean and doesn’t do anything special so I don’t think it causes any bug like that.

Hi Warren! Christophe has not answered if he is going to add this feature of turning off the count. I can’t find another plugin that does what this one does, but I need it without the count! How did you hack the plugin?

Currently it is not possible to change the sort order through the options, however you can change it easily in the plugin code if you know a bit of SQL. How do you want to sort the entries? I could consider adding the option.