txp:category2

The category2 tag can be used as either a single or containing 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.

Syntax

The category2 tag has the following syntactic structure…

<txp:category2 />

Attributes

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

title="boolean"

Whether to output category title, rather than name. Available values: 1 (yes) or 0 (no, output name). Default is 0 (no).

link="boolean"

Whether to link to articles from the same category. Available values: 1 (yes) or 0 (no). Default is 0 (no).

section="section name"

Only link to articles from the specified section. Default is unset.

this_section="boolean"

Whether to only link to articles from the section containing the current article. Available values: 1 (yes) or 0 (no). Default is 0 (no, allow from any section).

class="class name"

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

wraptag="tag"

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

Examples

Display the Cat2 category of the article being displayed in plain text

<txp:category2 />

Display the Cat2 category hyperlinked to search for articles of the same category

<txp:category2 link="1" />

If category2 is “General”, this tag returns the following URL

http://yoursite.com/category/general

If you find you have URL mode or version conflicts with this, what follows will serve as well.

<a href="/subdirectory/index.php?c=<txp:category2 />"><txp:category2 /></a>

Genealogy

Version 4.0.4

* encode, class, section, this_section, wraptag added.

txp/category2.txt · Last modified: 2008/02/02 06:50 by hcgtv

Home Page | User Forums | Driven by DokuWiki
Copyright © 2008 xPattern