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
add default for param. #2 and i18n method (none)
m format
Line 1: Line 1:
{{TemplateBox
{{TemplateBox
|1=1
|1=1
|1d=category name
|1d=category name, with or without a namespace
|1def=
|1def=
|1stat=required
|1stat=required
Line 41: Line 41:
== Usage ==
== Usage ==
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 text string in parameter 1 or 2 is displayed as-it-is, with namespace if any was specified.


The function is different for internal access within the commons, and for interwiki access.
The function is different for internal access within the commons, and for interwiki access.
Line 65: Line 67:




*<tt><nowiki>{{C|Category-not-existing}}</nowiki></tt> produces {{C|Category-not-existing}}
::(difficult to find an example, try one of [[Special:WantedCategories]])
*<tt><nowiki>{{C|Category-not-existing|Red_Link}}</nowiki></tt> produces {{C|Category-not-existing|Red_Link}}
*<tt><nowiki>{{C|Redes}}</nowiki></tt> produces {{C|Redes}}
*<tt><nowiki>{{C|redes|Red_Link}}</nowiki></tt> produces {{C|redes|Red_Link}}





Revision as of 10:54, 23 February 2015

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

Usage

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

Template parameters

ParameterDescriptionDefaultStatus
1category name, with or without a namespaceemptyrequired
2link text to display (instead of category name)param. #1optional
3The 3rd parameter establishes either
  • interwiki access, with any language code,
or
  • a link to a category not on 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 (lower case): text is displayed in red color
if 3=X (upper case): display with red 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

Localization

This template is not intended to be localized.

Usage

The template will display {{{2}}}, or just the category name given as {{{1}}}.

The text string in parameter 1 or 2 is displayed as-it-is, with namespace if any was specified.

The function is different for internal access within the commons, and for interwiki access.

Addressing 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}}}}}}]]

When the category does not exist but has elements assigned, a "red link" will be generated:

[[:Category:{{{1}}}|{{{2|{{{1}}}}}}]]

Otherwise 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


(difficult to find an example, try one of Special:WantedCategories)
  • {{C|Redes}} produces Redes
  • {{C|redes|Red_Link}} produces Red_Link


  • {{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.