Template:C/doc

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, or just the category name given as.

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:

When the category does not exist but has elements assigned, a "red link" will be generated:
 * Category:

Otherwise if the category does not exist  no link will be generated ;
 * &#91;[Category:]&#93; or &#91;[Category:]&#93; is displayed
 * &#91;[Category:  ]&#93; or &#91;[Category:   ]&#93; is displayed when  = x
 * or  will get background color when  = X


 * examples:
 * produces
 * produces


 * produces
 * produces
 * produces
 * produces
 * produces


 * 1)   produces   produces
 * 2)   produces   produces
 * 3)   produces   produces
 * 4)   produces   produces


 * Not-existing category containing elements (difficult to find an example, try one of Special:WantedCategories)
 * produces
 * produces


 * Single and double namespace prefix:


 * produces
 * produces

Interwiki access
It is not possible to check for existence in other Wikipedias. The link is always established, whether the category exists or not.


 * or produces
 * produces
 * produces
 * produces
 * produces

Namespace display

 * produces
 * produces
 * produces