No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
{{Documentation}} | {{Documentation}} | ||
<includeonly><onlyinclude>[[:Category:{{{1|}}}|{{ucfirst:{{{1|}}}}}]]{{# | <includeonly><onlyinclude>[[:Category:{{{1|}}}|{{ucfirst:{{{1|}}}}}]]{{#switch:{{{2|}}} | ||
| end = category | |||
| add = [[Category:{{{1}}}]] | |||
| #default = {{Error|{{{2}}} is not a valid parameter for {{Template|Category}}}} | |||
}}</onlyinclude></includeonly> | |||
Revision as of 19:18, 24 October 2022
Template:Category is used to simplify the creation of links to categories.
Usage
It accepts one mandatory string parameter and one optional parameter:
1is the name of an article in the category namespace.2, can be arbitrary text, which will change the text presented by the link, or on eof three special options:addadds the article to the same category it is linking to.endadjusts the output, primarily for grammatical purposes.lcreturns the first parameter, but in all lower case.
Return
A normal Mediawiki category link, such as[[:Category:Admin]], returns:
With no optional parameters, it returns a link to the category page, without the namespace prepended. For instance, {{Category|Admin}} returns: AdminError! {{{2}}} is not a valid parameter for
If the second parameter is an arbitrary string, such as Template:Category!administrative, it returns: AdminError! administrative is not a valid parameter for
If the second parameter is Template:Category!lc, it returns: AdminError! lc is not a valid parameter for
If a second parameter is Template:Category!end, the return is modified: {{Category|Admin|end}} returns: Admin category
A second parameter of add cannot be demonstrated, as it does not work in the template namespace.
The documentation above was transcluded from Template:Category/Documentation. [edit]
