Jump to content

Template:Category TOC/doc: Difference between revisions

From cernipedia
shortcut|WP:CATTOC
m 101 revisions imported from wikipedia:Template:Category_TOC/doc
 
(46 intermediate revisions by 29 users not shown)
Line 1: Line 1:
{{Documentation subpage}}{{shortcut|WP:CATTOC}}
{{Documentation subpage}}{{shortcut|WP:CATTOC}}
<!--Categories where indicated at the bottom of this page, please; interwikis at Wikidata (see [[Wikipedia:Wikidata]])-->
<!--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 [[Wikipedia:Categorization|category]] page. It should ''only'' be added to category pages and should not be used for categories containing less than 400 pages.
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.


<pre style="overflow:auto;">
If necessary, {{tlc|Category TOC}} can also be called directly with the following syntax:
 
<syntaxhighlight lang="wikitext" style="overflow:auto;">
{{Category TOC
{{Category TOC
  | align    = <!-- left (default) / center / right -->
  | align    = <!-- left (default) / center / right -->
Line 12: Line 15:
  | uppercase = <!-- yes (default) / group / no -->
  | uppercase = <!-- yes (default) / group / no -->
  | lowercase = <!-- yes / group / no (default) -->
  | lowercase = <!-- yes / group / no (default) -->
}}</pre>
}}</syntaxhighlight>


===Parameters===
===Parameters===
Line 22: Line 25:
**'''no''': no link.
**'''no''': no link.
*''uppercase''&nbsp;– specifies whether uppercase letters are included:
*''uppercase''&nbsp;– specifies whether uppercase letters are included:
** '''yes''' (default): each letter A,B,...,Z has a separate link.
**'''yes''' (default): each letter A,B,...,Z has a separate link.
** '''group''': there is one link for A-Z.
**'''group''': there is one link for A-Z.
** '''no''': there is no link for uppercase letters.
**'''no''': there is no link for uppercase letters.
*''lowercase''&nbsp;– specifies whether lowercase letters are included:
*''lowercase''&nbsp;– specifies whether lowercase letters are included:
** '''yes''': each letter a,b,...,z has a separate link.
**'''yes''': each letter a,b,...,z has a separate link.
** '''group''': there is one link for a-z.
**'''group''': there is one link for a-z.
** '''no''' (default): there is no link for lowercase letters.
**'''no''' (default): there is no link for lowercase letters.


==Examples==
==Examples==
*{{tl2|Category TOC}}
{| class="" style="border: 1px solid #333;"
{{Category TOC}}
|+{{Sronly|Examples}}
*{{tl2|Category TOC|align{{=}}center}}
|-
{{Category TOC|align=center}}
|<syntaxhighlight inline lang="wikitext">{{Category TOC}}</syntaxhighlight>
*{{tl2|Category TOC|numerals{{=}}no}}
|{{Category TOC}}
{{Category TOC|numerals=no}}
|-
*{{tl2|Category TOC|uppercase{{=}}no|lowercase{{=}}yes}}
|<syntaxhighlight inline lang="wikitext">{{Category TOC|align=center}}</syntaxhighlight>
{{Category TOC|uppercase=no|lowercase=yes}}
|{{Category TOC|align=center}}
*{{tl2|Category TOC|numerals{{=}}separate}}
|-
{{Category TOC|numerals=separate}}
|<syntaxhighlight inline lang="wikitext">{{Category TOC|align=right}}</syntaxhighlight>
*{{tl2|Category TOC|numerals{{=}}separate|uppercase{{=}}no}}
|{{Category TOC|align=right}}
{{Category TOC|numerals=separate|uppercase=no}}
|-
*{{tl2|Category TOC|numerals{{=}}separate|uppercase{{=}}group}}
|<syntaxhighlight inline lang="wikitext">{{Category TOC|top=no}}</syntaxhighlight>
{{Category TOC|numerals=separate|uppercase=group}}
|{{Category TOC|top=no}}
*{{tl2|Category TOC|uppercase{{=}}group|lowercase{{=}}group}}
|-
{{Category TOC|uppercase=group|lowercase=group}}
|<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}}


==See also==  
==TemplateData==
* [[:Template:Category TOC ATC]]
{{TemplateData header}}
* [[:Template:Category TOC (non-Latin)]]
<templatedata>
* [[:Template:Collapsible large category TOC]]
{
* [[:Template:Large category TOC]]
"params": {
* [[:Template:Large category TOC 2]]
"align": {
* [[:Template:Large category TOC numeric]]
"description": "Aligns {{Category TOC}} to either the left or center, depending on the value.",
* [[:Template:Compact ToC]] (for articles)
"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>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<includeonly>{{Sandbox other||
<!--Categories below this line, please; interwikis at Wikidata-->
<!--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

__EXPECTED_UNCONNECTED_PAGE__

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

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:

See also

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Category TOC in articles based on its TemplateData.

TemplateData for Category TOC

Displays a category table of contents. In most cases, you should call {{Automatic category TOC}} instead of this template.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
alignalign

Aligns {{Category TOC}} to either the left or center, depending on the value.

Suggested values
left center
Lineoptional
toptop

If true, displays a link to the "top" of the table of contents.

Booleanoptional
numeralsnumerals

Specifies how numbers are included. "group" (default) generates one link for 0–9. "separate" generates one link per number. "no" hides numbers entirely.

Suggested values
group separate no
Lineoptional
uppercaseuppercase

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.

Suggested values
yes group no
Lineoptional
lowercaselowercase

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.

Suggested values
no yes group
Lineoptional