No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
{{Template|Category}} is used to simplify the creation of links to categories. | {{Template|Category}} is used to simplify the creation of links to categories. | ||
==Usage== | ==Usage== | ||
It accepts one {{Parameter|mandatory|string}} | It accepts one {{Parameter|mandatory|string}} and one {{Parameter|optional}}: | ||
* {{Code|1}} is the name of an article in the category namespace. | |||
* {{Code|2}}, if supplied, must be one of two options: | |||
** {{Code|end}} adjusts the output, primarily for gramatical purposes. | |||
** {{Code|add}} adds the article to the same category it is linking to. | |||
==Return== | ==Return== | ||
It returns a link to the category page, without the namespace prepended. For instance, {{Code|<nowiki>{{Category|Admin}}</nowiki>}} returns: {{Return|{{Category|Admin}}}} | It returns a link to the category page, without the namespace prepended. For instance, {{Code|<nowiki>{{Category|Admin}}</nowiki>}} returns: {{Return|{{Category|Admin}}}} | ||
| Line 8: | Line 12: | ||
If a second parameter of {{Code|end}} is included, the return is modified: {{Code|<nowiki>{{Category|Admin|end}}</nowiki>}} returns: {{Return|{{Category|Admin|end}}}} | If a second parameter of {{Code|end}} is included, the return is modified: {{Code|<nowiki>{{Category|Admin|end}}</nowiki>}} returns: {{Return|{{Category|Admin|end}}}} | ||
A second parameter of {{Code|add}} can not be demonstrated, as it does not work in the template namespace. | |||
Revision as of 19:21, 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, if supplied, must be one of two options:endadjusts the output, primarily for gramatical purposes.addadds the article to the same category it is linking to.
Return
It returns a link to the category page, without the namespace prepended. For instance, {{Category|Admin}} returns:
This is in contrast to a normal Mediawiki category link, such as [[:Category:Admin]], which would return:
If a second parameter of end is included, the return is modified: {{Category|Admin|end}} returns:
Admin category
A second parameter of add can not be demonstrated, as it does not work in the template namespace.
