dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Search | Go
Wiki > Main > UsingCategoryTags

How to use Category tags


A category tag is nothing special, really. It's just a single line of text that twiki can search for and thus create an index of the pages which have it.

Tag pages

Add an empty line to the end of the page you want indexed:

CategoryFoo: Description

It is important that the category tag is the only thing on that line. It might be a good idea to put a separator (---) above the category line, to clearly mark it as metadata and not part of the page body.

Create an index page

The index page is simply using a %SEARCH% expression to find all pages with the category tag.

An example expression is this:

%SEARCH{"^CategoryHowto:" regex="on" type="regex" nototal="on" nosearch="on" format=" * $topic - $pattern(.*?CategoryHowto:([^\n\r]*).*)" }%

...which results in this output:

See TWikiVariables? for the syntax of %SEARCH% and FormattedSearch? for the formatting syntax of the header and format attributes.
r1 - 18 Jun 2004 - 14:33:00 - BjornStenberg

Copyright by the contributing authors.