User:TheresaWilson/Cats n Stuff

Temporary Page to research WV's Category layout

The &lt;categorytree&gt; tag
Example:

The custom tag is called &lt;categorytree&gt;. For example, if you put &lt;categorytree&gt;Foo&lt;/categorytree&gt; on a wiki page, it will show the contents of category Foo as a dynamic tree on that page (see example to the right). The tag accepts the following attributes, using a HTML-like syntax :


 * mode: determines which pages are shown in the tree. This may be overridden by the use of the namespaces option. Possible values:
 * categories: show subcategories only (configuration constant CT_MODE_CATEGORIES )
 * pages: show subcategories and pages, except images (configuration constant CT_MODE_PAGES )
 * all: show all pages, subcategories, images, etc (configuration constant CT_MODE_ALL )
 * parents: list parent categories instead of subcategories (configuration constant CT_MODE_PARENTS ). This puts CategoryTree into "inverse" operation (supported since 36892, July 2008).


 * depth: determines how many levels of the tree are shown initially. Default is 1, 0 means only the root node. The maximum value depends on the mode specified, and on the $wgCategoryTreeMaxDepth option. (introduced between r20410 and 20840, Mar 30 2007; fully functional even with $wgCategoryTreeDynamicTag since 36864, July 2008)
 * onlyroot : set this to "on" to only show the "root" node of the tree initially. Equivalent to depth="0". (introduced in 20385, March 13 2007) Deprecated as of 36864, July 2008: use depth="0" instead.
 * hideroot: set this to "on" to hide the "root" node of the tree, i.e. the mention of category Foo from the example.
 * hideprefix: determines when the namespace prefix should be hidden from entries in the tree (since 36864, July 2008). Possible values are:
 * always: always hide the prefix. Should be used only if all pages come from the same namespace (configuration constant CT_MODE_CT_HIDEPREFIX_ALWAYS ).
 * never: never hide the namespace prefix, not even for categories (configuration constant CT_MODE_CT_HIDEPREFIX_NEVER ).
 * auto: hide the namespace of categories, if only categories are shown, as with mode="categories" (configuration constant CT_MODE_CT_HIDEPREFIX_AUTO ); This is equivalent to the old default behavior (before Jun 2008).
 * categories: always hide the namespace of categories, but show all other prefixes (configuration constant CT_MODE_CT_HIDEPREFIX_CATEGORIES ). This is the new default behavior (since 36864, July 2008).


 * showcount: show the number of entires in subcategories (since 36864, July 2008). This is disabled per default for category trees inlined on pages, but enabled per default in category listings an on Special:CategoryTree.
 * namespaces: a list of namespaces from which pages should be shown in the tree (since 36864, July 2008). The entries in the list must be namespace names, separated by spaces. The main namespaces can be represented by "-" or "0". This overrides the mode option.
 * class, style, id, etc: The &lt;categorytree&gt; tag supports all standard HTML attributes for block elements (since 36864, July 2008. Before that, only style was supported).

The parser function
Since 25825 (2007-9-13), you can also use parser function syntax to place a category tree on a page. This works just like the &lt;categorytree&gt; tag, using a different syntax, e.g. ; options can be specified using the syntax for named template parameters, e.g..

Using the parser function syntax has the advantage that it allows you to use magic words, templates and template parameters when specifying the category to show. Some examples:
 * Using a magic variable to show "this pages" category tree (may be useful on category description pages):.
 * Using a template to specify the category: - the name of the root category would be defined by the contents of Template:Root_category.
 * Using a template parameter to specify the category, when using CategoryTree inside a template: in Template:Baz can be called using