Template:Category tree all/doc: Difference between revisions
Template page
More actions
m adapt examples for Commons |
m document alignright |
||
| Line 14: | Line 14: | ||
** showcount=on displays the number of sub-subcategories after each subcategory. | ** showcount=on displays the number of sub-subcategories after each subcategory. | ||
** header=a user-defined header to override the default, for example "click '''+''' to show pages" | ** header=a user-defined header to override the default, for example "click '''+''' to show pages" | ||
* {{tlx|category tree all|8=alignright=yes}} - basic right-aligned form | |||
* {{tlx|category tree all|2=mode=categories or pages or all or parents|8=alignright=yes}} - right-aligned form with mode parameter | |||
====Examples==== | ====Examples==== | ||
| Line 70: | Line 72: | ||
{{clear}} | {{clear}} | ||
{{-}} | {{-}} | ||
* {{tlx|category tree all|2=Astronomy|3=mode=parents|4=|8=alignright=yes}} | |||
{{tlx|category tree all|2=Astronomy}} | |||
:will create these two boxes: | |||
{{category tree all|Astronomy|mode=parents|alignright=yes}} | |||
{{category tree all|Astronomy}} | |||
{{clear}}{{-}} | |||
=== See also === | === See also === | ||
Revision as of 15:00, 17 October 2009
Usage
This template displays a configurable showable list of subcategories, pages, images, or parent categories.
Syntax
- {{category tree all}} - basic form, uses the name of the category page it is placed on
- {{category tree all|
title}} - usestitleas the category page name - {{category tree all|mode=categories or pages or all or parents|depth=0, 1 or more|hideroot=on or off|showcount=on or off|header=user-defined header}} - uses more of the categorytree tag parameters (see http://www.mediawiki.org/wiki/Extension:CategoryTree for details):
- mode=pages displays only the pages in the category; mode=all displays subcategories, pages and images; mode=parents displays only the parent categories;
- depth=0 displays only the root node, depth=1 displays one level of the tree and so forth;
- hideroot=on hides the root category;
- showcount=on displays the number of sub-subcategories after each subcategory.
- header=a user-defined header to override the default, for example "click + to show pages"
- {{category tree all|alignright=yes}} - basic right-aligned form
- {{category tree all|mode=categories or pages or all or parents|alignright=yes}} - right-aligned form with mode parameter
Examples
- {{category tree all|
Films}}
- will create this box:
| To display all subcategories click on the "▶":
Category Films not found
|
- {{category tree all|
Films}}
- will create a box without numbers:
| To display all subcategories click on the "▶":
Category Films not found
|
- {{category tree all|
Films by country|depth=0}}
- will create a box initially showing the root only:
| To display all subcategories click on the "▶":
Category Films by country not found
|
- {{category tree all|
Films by country|depth=1}}
- will create a box initially showing the tree to a depth of one:
| To display all subcategories click on the "▶":
Category Films by country not found
|
- {{category tree all|
Archaeoastronomy|mode=categories|depth=2|hideroot=off|showcount=on}}
- will create a box initially showing the tree to a depth of two:
| To display all subcategories click on the "▶":
Category Archaeoastronomy not found
|
- {{category tree all|
Astronomy|mode=categories|hideroot=off|showcount=on}}
- will create this box:
| To display all subcategories click on the "▶":
Category Astronomy not found
|
- {{category tree all|
Astronomy|mode=parents|depth=1|hideroot=on}}
- will create this box:
| To display all parents click on the "▶":
Category Astronomy not found
|
- {{category tree all|
Astronomy|mode=parents|depth=0|hideroot=off|header=This is a user-defined header, click + to show parent categories:}}
- will create this box:
| This is a user-defined header, click + to show parent categories:
Category Astronomy not found
|
- {{category tree all|
Archaeoastronomy|mode=categories|depth=2|hideroot=off|showcount=on|Astronomy education}}
- will create this box:
| This is a user-defined header, click something
Category Archaeoastronomy not found
|
- {{category tree all|Astronomy|mode=parents|alignright=yes}}
{{category tree all|Astronomy}}
- will create these two boxes:
| To display all parents click on the "▶":
Category Astronomy not found
|
| To display all subcategories click on the "▶":
Category Astronomy not found
|
See also
- {{Category tree}} - simpler template that shows subcategories only
- mw:Extension:CategoryTree
- en:Template:Category tree - similar template on the English Wikipedia