Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:C/doc: Difference between revisions

Template page
m expansion
m interwiki expansion
Line 9: Line 9:
|2stat=optional
|2stat=optional
|3=3
|3=3
|3d=if <tt>3=x</tt> (lc): text is displayed with red color<br>
|3d=The 3{{exp|rd}} parameter establishes either
if <tt>3=X</tt> (uc): text is displayed with colored background
*interwiki access, with any language code
*a link to a category of the Commons, always with check for existence
**existing categories are linked and displayed
**non-existing categories are not linked, but displayed
::(not specified): text is displayed in black color
::if <tt>3=x</tt> (lc): text is displayed in red color
::if <tt>3=X</tt> (uc): text is displayed with colored background


|3def=
|3def=
|3stat=optional
|3stat=optional
|name=C
|name=C
|desc=Displays category links
|desc=Links to a category, either within the Commons or to another Wikipedia
|namespace=all
|namespace=all
|usergroup=all
|usergroup=all
Line 32: Line 38:
}}
}}


;usage
== Usage ==
: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>.
:If the category <nowiki>{{{1}}}</nowiki> does not exist  <u>no link will be generated</u>;
::&#91;[''Category'':{{{1}}}]&#93; or &#91;[''Category'':{{{2}}}]&#93; is displayed
::&#91;[''Category'':<span style="color:red"><nowiki>{{{1}}}</nowiki></span>]&#93; or &#91;[''Category'':<span style="color:red"><nowiki>{{{2}}}</nowiki></span>]&#93; 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


::''When category exists'', code is implemented as:
The function is completely different for access within the commons, and for interwiki access.
::<nowiki>[[:Category:{{{1}}}|{{{2|{{{1}}}}}}]]</nowiki>  
 
=== Adressing categories within the commons ===
First of all, always a check for existence is performed.
 
When the category exists, code is implemented as:
:<nowiki>[[:Category:{{{1}}}|{{{2|{{{1}}}}}}]]</nowiki>  
 
If the category <nowiki>{{{1}}}</nowiki> does not exist  <u>no link will be generated</u>;
:&#91;[''Category'':{{{1}}}]&#93; or &#91;[''Category'':{{{2}}}]&#93; is displayed
:&#91;[''Category'':<span style="color:red"><nowiki>{{{1}}}</nowiki></span>]&#93; or &#91;[''Category'':<span style="color:red"><nowiki>{{{2}}}</nowiki></span>]&#93; 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




Line 46: Line 58:
*<tt><nowiki>{{C|Internal link templates}}</nowiki></tt> produces {{C|Internal link templates}}
*<tt><nowiki>{{C|Internal link templates}}</nowiki></tt> produces {{C|Internal link templates}}
*<tt><nowiki>{{C|Internal link templates|}}</nowiki></tt> produces {{C|Internal link templates|}}
*<tt><nowiki>{{C|Internal link templates|}}</nowiki></tt> produces {{C|Internal link templates|}}
*<tt><nowiki>{{C|Internal link templates|display}}</nowiki></tt> produces {{C|Internal link templates|display}}
*<tt><nowiki>{{C|Internal link templates|C:''display''text}}</nowiki></tt> produces {{C|Internal link templates|C:''display''text}}




Line 52: Line 64:
*<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|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-cat|x}}</nowiki></tt> produces {{C|not-existing-cat|display-cat|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|displayname|X}}</nowiki></tt> produces {{C|not-existing-cat|displayname|X}}
 
 
=== Interwiki access ===
It is not possible to check for existence in other Wikipedias. 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|Wikipedia:Hilfe|German help pages|de}}</nowiki></tt> produces {{C|Wikipedia:Hilfe|German help pages|de}}
*<tt><nowiki>{{C|Accueil|Catégorie:Accueil|fr}}</nowiki></tt> produces {{C|Accueil|Catégorie:Accueil|fr}}


<includeonly>
<includeonly>
[[Category:Internal link templates]]
[[Category:Internal link templates|{{PAGENAME}}]]
[[Category:Typing-aid templates]]
[[Category:Interwiki link templates|{{PAGENAME}}]]
[[Category:Typing-aid templates|{{PAGENAME}}]]
</includeonly>
</includeonly>

Revision as of 10:31, 26 February 2012

Links to a category, either within the Commons or to another Wikipedia

Usage

{{C |1= |2= |3= }}

Template parameters

ParameterDescriptionDefaultStatus
1category nameemptyrequired
2link text to display (instead of category name)emptyoptional
3The 3rd parameter establishes either
  • interwiki access, with any language code
  • a link to a category of the Commons, always with check for existence
    • existing categories are linked and displayed
    • non-existing categories are not linked, but displayed
(not specified): text is displayed in black color
if 3=x (lc): text is displayed in red color
if 3=X (uc): text is displayed with colored background
emptyoptional

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 completely different for 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|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.


Cookies help us deliver our services. By using our services, you agree to our use of cookies.