Difference between revisions of "Template:Template category/doc"

m (Fixing it up)
m (Fixing it up)
Line 2: Line 2:
 
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
 
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
  
{{tlx|Template category}} should be placed at the top of categories that contain template pages and their related subcategories. This template populates [[:Category:Wikipedia template categories]].
+
{{tlx|Template category}} should be placed at the top of categories that contain template pages and their related subcategories.
  
 
{{TOC limit|3}}
 
{{TOC limit|3}}
Line 19: Line 19:
 
| onright =  
 
| onright =  
 
| type =  
 
| type =  
| container =
 
 
| topic =  
 
| topic =  
 
| description =  
 
| description =  
Line 27: Line 26:
 
</pre>
 
</pre>
  
===Parameters and examples===
+
==Parameters and examples==
 
The template may be used without any parameters.
 
The template may be used without any parameters.
  
Line 38: Line 37:
 
====''onright''====
 
====''onright''====
 
<hr/>
 
<hr/>
: Use ''onright'' (or ''rhs'') to place right-aligned boxes beside the template such as {{tl|Portal}} (to provide link/s to related portal/s), {{tl|Commons category}} (to provide a link to the same or a similarly-named Commons category), etc. If more than one box is included, ensure the widest one appears first (see example below) otherwise overlapping may occur.
+
: Use ''onright'' (or ''rhs'') to place right-aligned boxes beside the template. If more than one box is included, ensure the widest one appears first (see example below) otherwise overlapping may occur.
  
 
{{Hidden begin |showhide=left |title=''topic'', ''onright'' |bodystyle=font-size:105%;}}
 
{{Hidden begin |showhide=left |title=''topic'', ''onright'' |bodystyle=font-size:105%;}}
Line 44: Line 43:
 
{{Template category
 
{{Template category
 
| topic = the [[United States]]
 
| topic = the [[United States]]
| onright = {{Commons category|United States|the United States}}{{Portal|United States}}
+
| onright = {{Commons category|United States|the United States}}
 
}}
 
}}
 
</pre>
 
</pre>
 
{{Template category
 
{{Template category
 
| topic = the [[United States]]
 
| topic = the [[United States]]
| onright = {{Commons category|United States|the United States}}{{Portal|United States}}
+
| onright = {{Commons category|United States|the United States}}
 
}}
 
}}
 
{{Hidden end}}
 
{{Hidden end}}

Revision as of 22:36, 29 September 2022

{{Template category}} should be placed at the top of categories that contain template pages and their related subcategories.

Usage

Syntax

Basic
{{Template category
|description=
}}
Full
{{Template category
| onright = 
| type = 
| topic = 
| description = 
| ALTTEXT = 
| help = 
}}

Parameters and examples

The template may be used without any parameters.

With no parameters

The following, however, may be used to make the template more informative:

onright


Use onright (or rhs) to place right-aligned boxes beside the template. If more than one box is included, ensure the widest one appears first (see example below) otherwise overlapping may occur.
topic, onright
{{Template category
| topic = the [[United States]]
| onright = {{Commons category|United States|the United States}}
}}

Template:Commons category

type


Setting type to one of the following values adds a preset note as to which type of template the category (but not necessarily its subcategories) is meant to contain. The values are:
  • ambox
  • campaignbox
  • (category header
  • category heading
  • catheader
  • cat header
  • cathead)
  • conversion
  • external link
  • formatting
  • function
  • infobox
  • message
  • meta
  • module
  • (navigation
  • navigational
  • navbox)
  • sidebar
  • stub
  • sub
  • timeline
  • (user
  • userbox)
If type is set to something other than one of these values, the default "The pages listed in this category are templates" note appears unmodified.
type alone
{{Template category |type=sidebar}}

container


Set container as true, yes, etc. to identify the category as a container category, i.e. a category meant to contain only subcategories. A note requesting that no templates are added to the template category is then included. The category is automatically added to Category:Container categories.
container alone
{{Template category |container=true}}
An alternative to using container is to place {{Container category}} after the {{Template category}} template:
{{Container category}} following {{Template category}}
{{Template category
| type = ''type''
| topic = ''[[topic]]''
| description = This text supplied by the ''description'' parameter.
}}
{{Container category}}

topic


Use topic to add a default description ending "...relating to topic", where topic is usually a wikilink to the main article associated with the category (e.g. United States for the Category:United States templates).
topic alone
{{Template category |topic=the [[United States]]}}
type, topic
{{Template category |type=infobox |topic=the [[United States]]}}

description


Use description if a customised description is needed instead of – or, if topic also used, to follow – the default description above.
type, topic, description
{{Template category
| type = navbox
| topic = [[China]]
| description = <br />{{small|For templates relating specifically to the [[People's Republic of China|People's Republic of China (PRC)]] or the current [[Taiwan|Republic of China (ROC, "Taiwan")]], see, respectively, {{c|People's Republic of China templates}} and {{c|Taiwan templates}}.}}
}}
description alone
{{Template category |description=This text is supplied by the ''description'' parameter.}}

help


Use help to replace the instructions on adding a template to the category (second paragraph of the "Further template category notes" section):
replace help text
{{Template category |help=This text supplied by the ''help'' parameter.}}
To omit the default instructions, set help to no:
omit help text
{{Template category |help=no}}

Tracking category

Uses with a topic or description parameter are tracked:

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools.

TemplateData for Template category

This template is used as a header for category pages that contain templates.

Template parameters

ParameterDescriptionTypeStatus
Onrightonright rhs

no description

Unknownoptional
Typetype

no description

Unknownoptional
Containercontainer

no description

Unknownoptional
Topictopic

no description

Unknownoptional
Descriptiondescription 1

no description

Unknownoptional
ALTTEXTALTTEXT

no description

Unknownoptional
Helphelp 2

no description

Unknownoptional
Categorycategory

no description

Unknownoptional

See also

Other category-header templates