This extension provides a dynamic view of categories in the form of a tree. :See also full category tree of the whole Appropedia wiki site.

Usage[edit | edit source]

The same graphic object can be made to appear by the user on any page, inserting it in the wikicode as a custom HTML tag (or a parser function ), to show the structure of any category.

A CategoryTree can be used in three ways:

  1. directly on the category pages (through the wiki site's settings).
  2. as a "custom tag" to show a category structure in-line on a wiki page.
  3. and as a special page.

The CategoryTree extension adds [+] "expand" widgets to the subcategories listed on category pages. If Javascript is disabled, those widgets just do nothing.

The <categorytree> tag[edit | edit source]

The name of the category must be inserted inside the tag, without prefix. For example:

<categorytree>Energy</categorytree> produces:

The tag accepts the following attributes with HTML-like syntax:

can be "categories", "pages" or "all". The default for this attribute is set to "categories". (E.g. <categorytree mode=pages>Gardening</categorytree> will show all the subcategories and pages in the Gardening category.
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. note: depth values greater than 1 do not (yet) work with $wgCategoryTreeDynamicTag enabled!
set this to "on" to only show the "root" node of the tree initially. Equivalent to depth="0". Deprecated USE depth="0"
set this to "on" to hide the "root" node of the tree, i.e. the mention of category Foo from the example.
can be used to specify any CSS styles you would like for the tree.

The parser function[edit | edit source]

You can also use parser function syntax to insert a category tree into a page. It works exactly like the <categorytree> tag, but using a different syntax, the parameters must be set using the typical syntax of templates. For example: {{#categorytree:CATEGORYNAME|mode=pages}}

Example[edit | edit source]

Renders as Expected rendering

Interwiki links[edit | edit source]