Table of Contents

txp:category_list

The category_list tag is a Single Tag which is used to produce a list of linked categories. Its context is page or column.

Syntax

The category_list tag has the following syntactic structure…

<txp:category_list />

Attributes

Tag will accept the following attributes (case-sensitive):

parent="category name"

Return only specified category and its “children” categories.

categories="category name(s)"

Comma-separated list of categories to include, displayed in the order specified (unless overridden by sort attribute). Default is unset, leading to an unrestricted list of all categories.

exclude="category name(s)"

List of category names which will be excluded from the list. categories takes precendence over exclude. Default is unset.

type="category type"

Available values: article, image, link, file. Default is article.

sort="sort value(s)"

How to sort the resulting list. Available values: id, name, type, parent, title, rand() random. Default is name asc.

label="text"

String to be prepended to the list. Default is unset.

section="section name"

Link to specified section. Default is unset, resulting in links without section restriction.

this_section="boolean"

Link to currently active section (overrides section attribute). Default is 0 (no).

labeltag="tag"

(X)HTML tag (without brackets) to wrap around label. Default is unset.

wraptag="tag"

(X)HTML tag (without brackets) to wrap around list. Default is unset.

break="value"

(X)HTML tag (without brackets) or string used to separate list items. Default is br.

class="class name"

(X)HTML class attribute to be applied to wraptag. Default is category_list.

active_class="class name"

(X)HTML class attribute to be applied to the “active” or current link in a list. Default is unset.

Examples

Display a linked category list with the label "Categories"

<txp:category_list label="Categories" wraptag="p" break="br" />

Display a styled category list

<txp:category_list break="li" wraptag="ul" />

Styles could go this way:

.category_list {
     list-style-type:none;
     }

Genealogy

Version 4.0.4