<txp:category_list /> sing/cont tag, 10 attributes


The category_list tag can be used as either a single tag or container tag which is used to produce a list of linked categories.

Related: if_category, if_first_category, if_last_category


  • Return only specified category and its “children” categories.
  • Comma-separated list of categories to include, displayed in the order specified (unless overridden by sort attribute). Use category names not Titles here — note that TXP automatically converts the names to lower case and converts spaces to hyphens when they are created
  • List of category names which will be excluded from the list. categories takes precedence over exclude.
  • Available values: article, image, link, file.
children="1" (boolean) 
  • Can limit the list depth to one level below the parent category.
  • Values: 0 (no children, i.e. only show one level below the parent) or 1 (all nested categories).
sort="name asc" 
  • Values
    • id
    • name
    • type
    • parent
    • title
    • rand() (random)
  • Direction
    • asc (ascending)
    • desc (descending)
form="form name" 
  • Use the specified form to process each included category.
  • Link to specified section.
this_section="0" (boolean) 
  • Link to currently active section (overrides section attribute).
  • (X)HTML class attribute to be applied to the “active” or current link in a list (only works in the single tag without the form attribute).


  • Label prepended to item (or as first list item, where appropriate).
  • if wraptag is available and is set to ol or ul, the label will be the first list item.
  • (X)HTML tag (without brackets) to wrap around label.
  • (X)HTML tag (without brackets) or string to separate list items.
  • (X)HTML tag (without brackets) to wrap around the list.
  • (X)HTML class attribute to apply to the wraptag.


Version 4.0.7

  • Can be used as a container tag.
  • form and children attributes added.

Version 4.0.4

  • active_class, categories, exclude, section, this_section added.
<txp:category_list /> 3 examples

Labeled category list

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

As an unordered list

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

Styles could go this way

.category_list {

Set active class using the container tag

This code will add class=“active” to the <li> element around the “current” category in the list.

<txp:category_list wraptag="ul" break="">
<li<txp:if_category name='<txp:category />'> class="active"</txp:if_category>>
<txp:category title="1" link="1" />