Template:CategoryTOC

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Documentation icon 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

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).