category_list
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
attributes
parent="unset"
categories="unset"
exclude="unset"
type="article"
children="1" (boolean)
sort="name asc"
form="form name"
section="unset"
this_section="0" (boolean)
active_class="unset"
presentation
label="unset"
labeltag="unset"
break="br"
wraptag="unset"
class="category_list"
genealogy
Version 4.0.7
Version 4.0.4
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 {
list-style-type:none;
}
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" />
</li>
</txp:category_list>