Difference between revisions of "Template:Category tree"
Jump to navigation
Jump to search
imported>Fayenatic london (Add ifexist solely to create a link to the category which will show up in "What links here" from the category. This is needed because the categorytree function does not create that backlink) |
imported>Fayenatic london m (Parameter has to be {{{1|{{PAGENAME}}}}}) |
||
| Line 3: | Line 3: | ||
|- | |- | ||
| {{#tag: categorytree| {{{1|{{PAGENAME}}}}}|depth={{{depth|0}}}}}<!-- | | {{#tag: categorytree| {{{1|{{PAGENAME}}}}}|depth={{{depth|0}}}}}<!-- | ||
| − | the following ifexist is just to add a backlink to the main category, so that the page using this template will show up in "What links here" from the category -->{{#ifexist:Category:{{PAGENAME}}}} | + | the following ifexist is just to add a backlink to the main category, so that the page using this template will show up in "What links here" from the category -->{{#ifexist:Category:{{{1|{{PAGENAME}}}}}}} |
|}<noinclude>{{Documentation}}<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --></noinclude> | |}<noinclude>{{Documentation}}<!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --></noinclude> | ||
Revision as of 15:33, 27 October 2018
| Click the "►" below to see all subcategories: |
|---|
Usage
Note that this template does not work as expected on either the mobile site or if users do not have JavaScript enabled. This affects about half of the readers at the English Wikipedia (as of 2016).
Syntax
{{Category tree}}– basic form, uses the name of the category page it is placed on{{Category tree|title}}– uses the unnamed parametertitleas the category name to be displayed{{Category tree|alignright=yes}}– align to the right{{Category tree|depth=2}}– display the tree already opened to 2 levels
Examples
{{Category tree|Films}} will create this box:
| Click the "►" below to see all subcategories: |
|---|
► Films |
{{Category tree|Films about cats|depth=1}} will create this box:
| Click the "►" below to see all subcategories: |
|---|
no subcategories |
See also
- {{Category tree all}} – version that lets the user configure the appearance
- {{Category tree both}} – displays two showable lists: subcategories at the left and parent categories at the right
- mw:Extension:CategoryTree
- commons:Template:Category tree
| The above documentation is transcluded from Template:Category tree/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |