Table of Contents

txp:category

The category tag can be used as either a single or containing tag. It will display information of the category as defined by the name attribute, or the one currently being viewed. When used as a containing tag, it will turn the contents into a link to the category. Otherwise, it will return plain text.

May be used in any context.

Syntax

The category tag has the following syntactic structure…

<txp:category />

Attributes

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

name="category name"

Display specific category. Default is unset (use current category).

type="category type"

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

title="boolean"

Whether to display category's title. Available values: 1 (yes) or 0 (no, display name). Default is 0 (no, display name).

link="boolean"

Whether to display as link. Available values: 1 (yes) or 0 (no). Default is 0 (no).

section="section name"

Restricts category search to named section. Default is current section (for backwards compatibility).

this_section="boolean"

Only link to articles from the current section. section attribute overrides this setting. Available values: 1 (yes) or 0 (no). Default is 0 (no).

class="class name"

(X)HTML class attribute, applied to wraptag. Default is unset.

wraptag="tag"

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

Examples

Displays the current category name

<txp:category />

Display hyperlinked category name

<txp:category link="1" />

Display hyperlinked category title

<txp:category title="1" link="1" />

Display "articles" category's title, hyperlinked

<txp:category name="articles" title="1" link="1" wraptag="p" />

Container Example

<txp:category name="book">My books</txp:category>

Genealogy

Version 4.0.4