Textpattern CMS Template Tags

<txp:category2 /> sing/cont tag, 6 attributes

category2

The category2 tag can be used as either a single tag or container tag. It will display information of the category as defined by Cat2 of the article being displayed. When used as a containing tag, it will turn the contents into a link to that category. Otherwise, it will return plain text.

This tag may be used within either an article form, or in a page, wrapped in an if_individual_article conditional tag.

Related: if_article_category

attributes

title="0" (boolean)
  • Whether to output category title, rather than name.
link="0" (boolean)
  • Whether to link to articles from the same category.
section="unset" 
  • Only link to articles from the specified section.
this_section="0" (boolean)
  • Whether to only link to articles from the section containing the current article.
class="unset" 
  • (X)HTML class attribute to be applied to wraptag.
wraptag="unset" 
  • (X)HTML tag (without brackets) to wrap around output.

genealogy

Version 4.0.4

  • class, section, this_section, wraptag added.
<txp:category2 /> 3 examples

Category name in plain text

<txp:category2 />

Hyperlinked category title

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

If category2 is “General”, this tag will display the word “General” as a hyperlink to a list of articles in the same category.

Container example

<txp:category2>
Other articles in category <txp:category2 title="1" />
</txp:category2>