Open main menu
Documentationviewedithistorypurge
This documentation is transcluded from Template:CategoryTOC/doc.

This template adds a table of contents (TOC) to a category page. It is generally not used for categories containing less than 500 total pages.

Usage

{{categoryTOC
 |lang =
 |numerals =
 |uppercase =
 |lowercase =
 |letters =
}}

Template parameters

ParameterDescriptionDefaultStatus
langlanguage codeThe language code of the alphabet to useenoptional
lang2language code 2The language code of the second alphabet to useemptyoptional
lang3language code 3The language code of the third alphabet to useemptyoptional
numeralsnumeralsSpecifies whether numerals are included:
  • group: there is one link for all numerals 0–9
  • separate: each numeral from 0 to 9 has a separate link
  • days: day of month from 1 to 31
  • no: no link
groupoptional
uppercaseuppercase lettersSpecifies whether there is a link for each uppercase letter from A to Z.yesoptional
lowercaselowercase lettersSpecifies whether there is a link for each lowercase letter from a to z.nooptional
lettersletters at allUse no to hide letters.yesoptional
Template data
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either useTemplateData=1 or useTemplateData=only on the /doc subpage and transcluding it with {{Documentation}} into the template. <nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw <templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

This template adds a table of contents (TOC) to a category page. It is generally not used for categories containing less than 500 total pages.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
language codelang

The language code of the alphabet to use

Default
en
Lineoptional
language code 2lang2

The language code of the second alphabet to use

Lineoptional
language code 3lang3

The language code of the third alphabet to use

Lineoptional
letters at allletters

Use no to hide letters.

Default
yes
Lineoptional
lowercase letterslowercase

Specifies whether there is a link for each lowercase letter from a to z.

Default
no
Lineoptional
numeralsnumerals

Specifies whether numerals are included. One of “group” (there is one line for all numerals 0–9), “separate” (each numeral from 0 to 9 has a separate link), “days” (days of month from 1 to 31) and “no” (no numeral link).

Default
group
Lineoptional
uppercase lettersuppercase

Specifies whether there is a link for each uppercase letter from A to Z.

Default
yes
Lineoptional

Additional information

The template is intended to be used in the following namespaces: the Category namespace

The template is intended to be used by the following user groups: all users

Placement: At the top of the page

See also

Localization

This template is localized by utilizing MediaWiki namespace messages. These can be translated at translatewiki.net (current translations).

The only translatable parts in this template are three MediaWiki pages: MediaWiki:Toc, MediaWiki:Top and MediaWiki:Colon (usually there is no need to translate the latter, but in French, for example, it’s used to insert a space before the colon).
https://commons.m.wikimedia.org/wiki/Template:Category_TOC
commons.m.wikimedia.org
crawl=CC-MAIN-2019-26
39941
application/http; msgtype=response
sha1:IO5IZ6YDZ5JQRQR6Y7OEM25DHNQQLPBC
<urn:uuid:b5f3e82d-a197-47ed-88c0-8b2e1080ddf9>
2019-06-24T11:15:10Z
208.80.154.224
text/html
sha1:4BSKAZVEUO2P4DX3ORXBAPA7UPAZ4MXN
<urn:uuid:f0980886-637b-4de3-9f93-1088c530ca0a>
https://commons.m.wikimedia.org/wiki/Template:Category_TOC
response
<urn:uuid:39681009-30ce-4867-9d4b-b0ccd7aea5d5>
isPartOf: CC-MAIN-2019-26
publisher: Common Crawl
description: Wide crawl of the web for June 2019
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-93-203-79.ec2.internal
software: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/