Note: This template is used on a great lot of pages. In order not to put too much load on the servers, edits should be kept to a bare minimum. Please discuss proposed changes on the talk page first.
Afterwards, changes can initially be done at and tested with Template:C/sandbox.
Editing a template causes all pages that use the template to be re-rendered. If the template is used often, this can put a lot of load on the servers since it fills up the job queue.
Keep in mind that templates that are used on file description pages also show up on other wikis.
This page is semi-protected from editing to prevent vandalism. Only established users can edit it.
Links to a category, either within the Commons or to another Wikipedia and offers additional options for the layout formatting, the linking and more.
In its simplest form {{c|category name}} does the same as [[:category:category name|category name]] : producing a link to a category displaying just category name (without prefixing with the namespace“Category:”).
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=1oruseTemplateData=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.
Links to a category, either within the Commons or to another Wikipedia and offers additional options for the layout formatting, the linking and more.
In its simplest form {{c|category name}} does the same as [[:Category:category name|category name]]: producing a link to a category displaying just “category name” (without prefixing with the namespace“Category:”).
Understrokes in the category name are replaced by spaces, a lowercase first character is converted to uppercase.
{{Igen/cat}} for categorizing – different possibilities parametrizable
Localization
This template is not intended to be localized.
The template does not generate any localizable text. With + or - always the namespace (in English) is used.
Usage
Standard usage
Displays a link to a category name.
Parameter 1 is the category name. Parameter 2 may specify any text do be displayed instead.
The template will display {{{2}}}, or just the category name given as {{{1}}} (but with replacing understrokes in the category name by spaces, and converting a lowercase first character to uppercase).
The standard usage is without any prefix and without a namespace. No test occurs, redlinks can result.
The text string in parameter 2 is always displayed as-it-is, with namespace if any is specified.
Extended usage
The function is different for internal access within the commons, and for interwiki access.
Within the commons
The template can generate 5 different displays, one for an existing and four for a not-existing category.
When parameter 3 is either X or x,
or when a namespace is encountered, a check for existence is performed.
This can avoid the generation of a redlink to a not-existing category.
When later the category is defined, the display occurs like standard as above.
When the category exists either with or without namespace the following explanation depends the existing category.
When the category exists, code is implemented as:
[[:Category:{{{1}}}|{{{2|{{{1}}}}}}]]
When the category does not exist but has elements assigned, a "red link" will be generated:
[[:Category:{{{1}}}|{{{2|{{{1}}}}}}]]
Otherwise if the category {{{1}}} does not exist no link will be generated;
[[Category:{{{1}}}]] or [[Category:{{{2}}}]] is displayed
[[Category:{{{1}}}]] or [[Category:{{{2}}}]] is displayed when {{{3}}} = x
{{{1}}}or{{{2}}} will get background color when {{{3}}} = X
{{ C | Internal link templates | link = n }} produces Internal link templates {{ C | Internal link templates | link = none }} produces Internal link templates
{{ C | Category:Internal link templates | link = n }} produces Category:Internal link templates {{ C | Category:Internal link templates | link = none }} produces Category:Internal link templates
Interwiki access
It is not possible to check for existence in other Wikipedias. The link is always established, whether the category exists or not.
{{ C | Main | en }} or {{ C | Main | 3 = en }} produces Main
{{ C | Wikipedia:Hilfe | German help pages | de }} produces German help pages