Template:Category TOC/doc: Difference between revisions
No edit summary |
m 101 revisions imported from wikipedia:Template:Category_TOC/doc |
||
| (66 intermediate revisions by 45 users not shown) | |||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}}{{shortcut|WP:CATTOC}} | ||
<!-- | <!--Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[Wikipedia:Wikidata]])--> | ||
{{High-use}} | |||
==Usage== | ==Usage== | ||
This template adds a table of contents (TOC) to a category page. | This template adds a [[table of contents]] (TOC) to a [[Wikipedia:Categorization|category]] page. Typically, {{tlx|Automatic category TOC}} should be used instead of this template. {{tlc|Automatic category TOC}} automatically picks whether to display no table of contents, this template, or {{t|Large category TOC}} depending on the size of the category. | ||
}} | |||
==Parameters== | If necessary, {{tlc|Category TOC}} can also be called directly with the following syntax: | ||
*''top'' | |||
*''numerals'' | <syntaxhighlight lang="wikitext" style="overflow:auto;"> | ||
{{Category TOC | |||
| align = <!-- left (default) / center / right --> | |||
| top = <!-- yes (default) / no --> | |||
| numerals = <!-- group (default) / separate / no --> | |||
| uppercase = <!-- yes (default) / group / no --> | |||
| lowercase = <!-- yes / group / no (default) --> | |||
}}</syntaxhighlight> | |||
===Parameters=== | |||
*''align'' – specifies the position. Default is '''left'''. | |||
*''top'' – specifies whether a link to the top of the category is included. Default is '''yes'''. | |||
*''numerals'' – specifies whether numerals are included: | |||
**'''group''' (default): there is one link for 0–9. | |||
**'''separate''': each numeral 0,1,...,9 has a separate link. | **'''separate''': each numeral 0,1,...,9 has a separate link. | ||
**'''no''': no link. | **'''no''': no link. | ||
*''uppercase'' | *''uppercase'' – specifies whether uppercase letters are included: | ||
*''lowercase'' | **'''yes''' (default): each letter A,B,...,Z has a separate link. | ||
**'''group''': there is one link for A-Z. | |||
**'''no''': there is no link for uppercase letters. | |||
*''lowercase'' – specifies whether lowercase letters are included: | |||
**'''yes''': each letter a,b,...,z has a separate link. | |||
**'''group''': there is one link for a-z. | |||
**'''no''' (default): there is no link for lowercase letters. | |||
==Examples== | |||
{| class="" style="border: 1px solid #333;" | |||
|+{{Sronly|Examples}} | |||
|- | |||
|<syntaxhighlight inline lang="wikitext">{{Category TOC}}</syntaxhighlight> | |||
|{{Category TOC}} | |||
|- | |||
|<syntaxhighlight inline lang="wikitext">{{Category TOC|align=center}}</syntaxhighlight> | |||
|{{Category TOC|align=center}} | |||
|- | |||
|<syntaxhighlight inline lang="wikitext">{{Category TOC|align=right}}</syntaxhighlight> | |||
|{{Category TOC|align=right}} | |||
|- | |||
|<syntaxhighlight inline lang="wikitext">{{Category TOC|top=no}}</syntaxhighlight> | |||
|{{Category TOC|top=no}} | |||
|- | |||
|<syntaxhighlight inline lang="wikitext">{{Category TOC|numerals=separate}}</syntaxhighlight> | |||
|{{Category TOC|numerals=separate}} | |||
|- | |||
|<syntaxhighlight inline lang="wikitext">{{Category TOC|numerals=no}}</syntaxhighlight> | |||
|{{Category TOC|numerals=no}} | |||
|- | |||
|<syntaxhighlight inline lang="wikitext">{{Category TOC|uppercase=group}}</syntaxhighlight> | |||
|{{Category TOC|uppercase=group}} | |||
|- | |||
|<syntaxhighlight inline lang="wikitext">{{Category TOC|uppercase=no}}</syntaxhighlight> | |||
|{{Category TOC|uppercase=no}} | |||
|- | |||
|<syntaxhighlight inline lang="wikitext">{{Category TOC|lowercase=yes}}</syntaxhighlight> | |||
|{{Category TOC|lowercase=yes}} | |||
|- | |||
|<syntaxhighlight inline lang="wikitext">{{Category TOC|lowercase=group}}</syntaxhighlight> | |||
|{{Category TOC|lowercase=group}} | |||
|- | |||
|} | |||
== Monitoring == | |||
Usage on small categories is discouraged. Use of category TOC templates is tracked as follows: | |||
{{Category TOC tracking categories|expand=yes}} | |||
== | ==See also== | ||
{{Category TOC see also}} | |||
== | ==TemplateData== | ||
{{TemplateData header}} | |||
<templatedata> | |||
{ | |||
"params": { | |||
"align": { | |||
"description": "Aligns {{Category TOC}} to either the left or center, depending on the value.", | |||
"type": "line", | |||
"suggestedvalues": [ | |||
"left", | |||
"center" | |||
] | |||
}, | |||
"top": { | |||
"description": "If true, displays a link to the \"top\" of the table of contents.", | |||
"type": "boolean" | |||
}, | |||
"numerals": { | |||
"description": "Specifies how numbers are included. \"group\" (default) generates one link for 0–9. \"separate\" generates one link per number. \"no\" hides numbers entirely. ", | |||
"type": "line", | |||
"suggestedvalues": [ | |||
"group", | |||
"separate", | |||
"no" | |||
] | |||
}, | |||
"uppercase": { | |||
"description": "Specifies how uppercase letters are included. \"yes\" (default) generates generates one link per letter. \"group\" generates one link for all of A–Z. \"no\" hides uppercase letters entirely. ", | |||
"type": "line", | |||
"suggestedvalues": [ | |||
"yes", | |||
"group", | |||
"no" | |||
] | |||
}, | |||
"lowercase": { | |||
"description": "Specifies how lowercase letters are included. \"no\" (default) hides lowercase letters entirely. \"yes\" generates generates one link per letter. \"group\" generates one link for all of a–z. ", | |||
"type": "line", | |||
"suggestedvalues": [ | |||
"no", | |||
"yes", | |||
"group" | |||
] | |||
} | |||
}, | |||
"format": "inline", | |||
"description": "Displays a category table of contents. In most cases, you should call {{Automatic category TOC}} instead of this template." | |||
} | |||
</templatedata> | |||
<includeonly> | <includeonly>{{Sandbox other|| | ||
<!--Categories--> | <!--Categories below this line, please; interwikis at Wikidata--> | ||
[[Category:Wikipedia category table of contents templates | [[Category:Wikipedia category table of contents templates]] | ||
[[Category:Category namespace templates | [[Category:Category namespace templates]] | ||
}}</includeonly> | |||
</includeonly> | |||
Latest revision as of 13:22, 19 November 2026
| icon | This is a documentation subpage for Template:Category TOC. It may contain usage information, categories and other content that is not part of the original template page. |
__EXPECTED_UNCONNECTED_PAGE__
| Warning | This template is used on approximately 81,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
Usage
This template adds a table of contents (TOC) to a category page. Typically, {{Automatic category TOC}} should be used instead of this template. {{Automatic category TOC}} automatically picks whether to display no table of contents, this template, or {{Large category TOC}} depending on the size of the category.
If necessary, {{Category TOC}} can also be called directly with the following syntax:
<syntaxhighlight lang="wikitext" style="overflow:auto;">
</syntaxhighlight>
Parameters
- align – specifies the position. Default is left.
- top – specifies whether a link to the top of the category is included. Default is yes.
- numerals – specifies whether numerals are included:
- group (default): there is one link for 0–9.
- separate: each numeral 0,1,...,9 has a separate link.
- no: no link.
- uppercase – specifies whether uppercase letters are included:
- yes (default): each letter A,B,...,Z has a separate link.
- group: there is one link for A-Z.
- no: there is no link for uppercase letters.
- lowercase – specifies whether lowercase letters are included:
- yes: each letter a,b,...,z has a separate link.
- group: there is one link for a-z.
- no (default): there is no link for lowercase letters.
Examples
| <syntaxhighlight inline lang="wikitext"> </syntaxhighlight>
|
|
| <syntaxhighlight inline lang="wikitext"> </syntaxhighlight>
|
|
| <syntaxhighlight inline lang="wikitext"> </syntaxhighlight>
|
|
| <syntaxhighlight inline lang="wikitext"> </syntaxhighlight>
|
|
| <syntaxhighlight inline lang="wikitext"> </syntaxhighlight>
|
|
| <syntaxhighlight inline lang="wikitext"> </syntaxhighlight>
|
|
| <syntaxhighlight inline lang="wikitext"> </syntaxhighlight>
|
|
| <syntaxhighlight inline lang="wikitext"> </syntaxhighlight>
|
|
| <syntaxhighlight inline lang="wikitext"> </syntaxhighlight>
|
|
| <syntaxhighlight inline lang="wikitext"> </syntaxhighlight>
|
Monitoring
Usage on small categories is discouraged. Use of category TOC templates is tracked as follows:
Category TOC tracking categories
|
|---|
{{Category TOC}}
|
See also
- {{Automatic category TOC}} — auto-selects no TOC, {{Category TOC}}, or {{Large category TOC}}
- {{Category TOC}}
- {{Category TOC custom}}
- {{Category TOC ATC}}
- {{Category TOC (Greek)}}
- {{Category TOC (Hebrew)}}
- {{Category TOC Unicode}}
- {{Collapsible large category TOC}}
- {{Large category TOC}}
- {{Large category TOC numeric}}
- {{Large category TOC years only}}
- {{Compact sub-TOC}}
- {{Compact TOC}} — for articles
TemplateData
TemplateData for Category TOC
Displays a category table of contents. In most cases, you should call {{Automatic category TOC}} instead of this template.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| align | align | Aligns {{Category TOC}} to either the left or center, depending on the value.
| Line | optional |
| top | top | If true, displays a link to the "top" of the table of contents. | Boolean | optional |
| numerals | numerals | Specifies how numbers are included. "group" (default) generates one link for 0–9. "separate" generates one link per number. "no" hides numbers entirely.
| Line | optional |
| uppercase | uppercase | Specifies how uppercase letters are included. "yes" (default) generates generates one link per letter. "group" generates one link for all of A–Z. "no" hides uppercase letters entirely.
| Line | optional |
| lowercase | lowercase | Specifies how lowercase letters are included. "no" (default) hides lowercase letters entirely. "yes" generates generates one link per letter. "group" generates one link for all of a–z.
| Line | optional |