Difference between revisions of "Template:Category tree"

From blackwiki
Jump to navigation Jump to search
imported>Primefac
m (Protected "Template:Category tree": semi-protecting highly-visible templates in response to recent template-space vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access]...)
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)
Line 2: Line 2:
 
! Click the "►" below to see all subcategories:
 
! Click the "►" below to see all subcategories:
 
|-
 
|-
| {{#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}}}}
 
|}<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 07:49, 25 October 2018

Click the "►" below to see all subcategories:
50px Template documentation[view] [edit] [history] [purge]

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

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