Template:C/doc: Difference between revisions
More actions
m interwiki expansion |
m expl |
||
| Line 10: | Line 10: | ||
|3=3 | |3=3 | ||
|3d=The 3{{exp|rd}} parameter establishes either | |3d=The 3{{exp|rd}} parameter establishes either | ||
*interwiki access, with any language code | *interwiki access, with any language code, | ||
::''or'' | |||
*a link to a category of the Commons, always with check for existence | *a link to a category of the Commons, always with check for existence | ||
**existing categories are linked and displayed | **existing categories are linked and displayed | ||
**non-existing categories are not linked, but displayed | **non-existing categories are not linked, but displayed | ||
::(not specified): text is displayed in black color | ::(not specified): text is displayed in black color | ||
::if <tt>3=x</tt> ( | ::if <tt>3=x</tt> (lower case): text is displayed in red color | ||
::if <tt>3=X</tt> ( | ::if <tt>3=<big>X</big></tt> (upper case): display with red background | ||
|3def= | |3def= | ||
| Line 41: | Line 42: | ||
The template will display <nowiki>{{{2}}}</nowiki>, or just the category name given as <nowiki>{{{1}}}</nowiki>. | The template will display <nowiki>{{{2}}}</nowiki>, or just the category name given as <nowiki>{{{1}}}</nowiki>. | ||
The function is | The function is different for internal access within the commons, and for interwiki access. | ||
=== Adressing categories within the commons === | === Adressing categories within the commons === | ||
| Line 70: | Line 71: | ||
=== Interwiki access === | === Interwiki access === | ||
It is not possible to check for existence in other Wikipedias. The link is always established, whether the category exists or not. | It is not possible to check for existence in other Wikipedias.<br>The link is always established, whether the category exists or not. | ||
*<tt><nowiki>{{C|Main||en}}</nowiki></tt> or <tt><nowiki>{{C|Main|3=en}}</nowiki></tt> produces {{C|Main||en}} | *<tt><nowiki>{{C|Main||en}}</nowiki></tt> or <tt><nowiki>{{C|Main|3=en}}</nowiki></tt> produces {{C|Main||en}} | ||
Revision as of 20:29, 25 March 2012
Links to a category, either within the Commons or to another Wikipedia
Usage
{{C |1= |2= |3= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | category name | empty | required | |
2 | link text to display (instead of category name) | empty | optional | |
3 | The 3rd parameter establishes either
| empty | optional | |
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
Usage
The template will display {{{2}}}, or just the category name given as {{{1}}}.
The function is different for internal access within the commons, and for interwiki access.
Adressing categories within the commons
First of all, always a check for existence is performed.
When the category exists, code is implemented as:
- [[:Category:{{{1}}}|{{{2|{{{1}}}}}}]]
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
- example
- {{C|Internal link templates}} produces Internal link templates
- {{C|Internal link templates|}} produces Internal link templates
- {{C|Internal link templates|C:''display''text}} produces C:displaytext
- {{C|not-existing-cat}} produces not-existing-cat
- {{C|not-existing-cat|display}} produces display
- {{C|not-existing-cat|3=x}} produces [[Category:not-existing-cat]]
- {{C|not-existing-cat|display-cat|x}} produces [[Category:display-cat]]
- {{C|not-existing-cat|3=X}} produces not-existing-cat
- {{C|not-existing-cat|displayname|X}} produces displayname
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
- {{C|Accueil|Catégorie:Accueil|fr}} produces Catégorie:Accueil