2,776 bytes added
, 16:03, 1 April 2010
=== What does this extension do? ===
This extension displays a category listing, including sub-categories, in a number of useful formats. This is intended to allow easier navigation of a wiki's category tree. It implements a new tag, <code><nowiki><ncl></nowiki></code>, which generates a list of all pages and sub-categories in a given category. The list can display multiple levels of sub-categories, and has several options for the display style.
This extensions mediawiki entry is [http://www.mediawiki.org/wiki/Extension:NiceCategoryList2 here].
===Usage===
The <code><nowiki><ncl></nowiki></code> tag displays a category list:
<nowiki><ncl</nowiki> ''[options]''>Category:Some Category<nowiki></ncl></nowiki>
The tag takes the following parameters, all of which are optional:
:;maxdepth=''<nowiki><number></nowiki>'': The maximum category depth to display; default 32
:;style=''<nowiki><style></nowiki>'': 'bullet' to show category contents as bullet lists (default); 'compact' for a more compact listing
:;showcats=''<nowiki><bool></nowiki>'': Non-0 to display sub-category links in "bottom" (ie. maxdepth) categories (default 0).
:;showarts=''<nowiki><bool></nowiki>'': Non-0 to display articles in categories (default 1).
:;headings=''<nowiki><style></nowiki>'': 'head' to display category headings as Wiki headings (default); 'bullet' to display category headings as large bullets ('headings=bullet' works well with 'style=compact').
:;headstart=''<nowiki><number></nowiki>'': With 'headings=head', the heading level to list top-level categories with (level increases for sub-cats) (default 1).
:;sort=''<nowiki><bool></nowiki>'': Non-0 to sort the list alphabetically; else sort the list according to the index key.
=== Examples ===
{|
|- valign=top
|
For a full, recursive listing of all categories under a specified category, use this:
<nowiki><ncl>Category:Some Category</ncl></nowiki>
|
[[Image:NiceCategoryList2 extension default.jpg|160px]]
|- valign=top
|
For a nice "high-level" category index, use this in a template:
<nowiki><ncl style=compact maxdepth=2 headings=bullet headstart=2
showcats=1 showarts=1>Category:{{PAGENAME}}</ncl></nowiki>
and include it in major category pages to provide a nice 2-level (or however many you like) index of the category.
|
[[Image:NiceCategoryList2 extension example.jpg|160px]]
|- valign=top
|
This:
<nowiki><ncl style=compact headings=bullet headstart=2 showcats=1
showarts=0>Category:Categories</ncl></nowiki>
generates a full category listing, with indentation indicating category containment.
|
[[Image:NiceCategoryList2 extension full.jpg|160px]]
|}
Caveat: When used in a template, the category list will not refresh immediately when reloaded; edit and save the article to see updates.