Template:C/doc: Difference between revisions
Template page
More actions
No edit summary |
m expansion |
||
| Line 9: | Line 9: | ||
|2stat=optional | |2stat=optional | ||
|3=3 | |3=3 | ||
|3d=if <tt>3=X</tt> | |3d=if <tt>3=x</tt> (lc): text is displayed with red color<br> | ||
if <tt>3=X</tt> (uc): text is displayed with colored background | |||
|3def= | |3def= | ||
|3stat=optional | |3stat=optional | ||
| Line 31: | Line 33: | ||
;usage | ;usage | ||
:Template will display | :Template will display <nowiki>{{{2}}}</nowiki>, or just the category name given as <nowiki>{{{1}}}</nowiki>. | ||
:If the category {{{1}}} does not exist no link will be generated; | :If the category <nowiki>{{{1}}}</nowiki> does not exist <u>no link will be generated</u>; | ||
::[[''Category'':{{{1}}}]] or [[''Category'':{{{2}}}]] is displayed | |||
::[[''Category'':<span style="color:red"><nowiki>{{{1}}}</nowiki></span>]] or [[''Category'':<span style="color:red"><nowiki>{{{2}}}</nowiki></span>]] is displayed when {{{3}}} = x | |||
::<span style="background-color:#FEDBCA"><nowiki>{{{1}}}</nowiki></span> or <span style="background-color:#FEDBCA"><nowiki>{{{2}}}</nowiki></span> will get background color when {{{3}}} = X | ::<span style="background-color:#FEDBCA"><nowiki>{{{1}}}</nowiki></span> or <span style="background-color:#FEDBCA"><nowiki>{{{2}}}</nowiki></span> will get background color when {{{3}}} = X | ||
[[:Category:{{{1}}}|{{{2|{{{1}}}}}}]] | ::''When category exists'', code is implemented as: | ||
::<nowiki>[[:Category:{{{1}}}|{{{2|{{{1}}}}}}]]</nowiki> | |||
;example | ;example | ||
| Line 50: | Line 50: | ||
*<tt><nowiki>{{C|not-existing-cat}}</nowiki></tt> produces {{C|not-existing-cat}} | *<tt><nowiki>{{C|not-existing-cat}}</nowiki></tt> produces {{C|not-existing-cat}} | ||
*<tt><nowiki>{{C|not-existing-cat|display}}</nowiki></tt> produces {{C|not-existing-cat|display}} | *<tt><nowiki>{{C|not-existing-cat|display}}</nowiki></tt> produces {{C|not-existing-cat|display}} | ||
*<tt><nowiki>{{C|not-existing-cat|3=x}}</nowiki></tt> produces {{C|not-existing-cat|3=x}} | |||
*<tt><nowiki>{{C|not-existing-cat|display|x}}</nowiki></tt> produces {{C|not-existing-cat|display|x}} | |||
*<tt><nowiki>{{C|not-existing-cat|3=X}}</nowiki></tt> produces {{C|not-existing-cat|3=X}} | *<tt><nowiki>{{C|not-existing-cat|3=X}}</nowiki></tt> produces {{C|not-existing-cat|3=X}} | ||
*<tt><nowiki>{{C|not-existing-cat|display|X}}</nowiki></tt> produces {{C|not-existing-cat|display|X}} | *<tt><nowiki>{{C|not-existing-cat|display|X}}</nowiki></tt> produces {{C|not-existing-cat|display|X}} | ||
Revision as of 09:00, 13 February 2012
Displays category links
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 | if 3=x (lc): text is displayed with red color if 3=X (uc): text is displayed with colored background | 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
- Template will display {{{2}}}, or just the category name given as {{{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
- When category exists, code is implemented as:
- [[:Category:{{{1}}}|{{{2|{{{1}}}}}}]]
- example
- {{C|Internal link templates}} produces Internal link templates
- {{C|Internal link templates|}} produces Internal link templates
- {{C|Internal link templates|display}} produces display
- {{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|x}} produces [[Category:display]]
- {{C|not-existing-cat|3=X}} produces not-existing-cat
- {{C|not-existing-cat|display|X}} produces display