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:W/doc: Difference between revisions

Template page
the difference from en:
use TemplateData
Line 1: Line 1:
{{TemplateBox
{{TemplateBox
|1=1
|1=1
|1d=page name; also specific [sub]pages (e.g: user, category, talk, ...)<br><u>if empty</u>, a link to the main page is created
|1d=page name; also specific [sub]pages (e.g: user, category, talk, ...)
|1def=
|1def=main page of the wiki
|1stat=
|1stat=required
 
|2=2
|2=2
|2d=display text<br><u>if empty</u>, the value passed with parameter #1 is displayed
|2d=display text
|2def=
|2def=parameter #1
|2stat=
|2stat=optional
 
|3=3
|3=3
|3d=language code (ISO 639), or sisterproject prefix<br><u>if empty</u>, the link is created to the English Wikipedia
|3d=language code (ISO 639), or sisterproject prefix
|3def=
|3def=en
|3stat=
|3stat=optoinal
 
|name=W
|name=W
|desc={{en|1=This is used to help create interwiki links, without displaying the prefix, and without the need for repetition if the link text is the same as target page name.
|desc-en=This is used to help create interwiki links, without displaying the prefix, and without the need for repetition if the link text is the same as target page name.
* The default prefix is simply <tt>w:</tt> which creates a link to the English Wikipedia. However the language can be specified in the third parameter.}}
* The default prefix is simply <tt>w:</tt> which creates a link to the English Wikipedia. However the language can be specified in the third parameter.
{{eo|1=Ĉi tiu ŝablono faciligas kreon de intervikiaj ligiloj.
  |desc-eo=Ĉi tiu ŝablono faciligas kreon de intervikiaj ligiloj.
* La prefikso sen specifo estas simple <tt>w:</tt> (kio nuntempe signifas anglalingvan Vikipedion), tamen lingvo estas specifebla per la tria argumento.}}
* La prefikso sen specifo estas simple <tt>w:</tt> (kio nuntempe signifas anglalingvan Vikipedion), tamen lingvo estas specifebla per la tria argumento.
|namespace=all
|namespace=all
|usergroup=all
|usergroup=all
Line 23: Line 26:
|type=linkage
|type=linkage
|example=
|example=
|i18n-method=
|i18n-method=-
|i18n-desc=
|i18n-desc=
|i18n-mediawiki-msg=
|i18n-mediawiki-msg=
Line 31: Line 34:
|shorthand=
|shorthand=
|relieson=
|relieson=
|useTemplateData=1
}}
}}
=== {{LangSwitch|default=Examples|eo=Kiel uzi|ru=Применение}} ===
=== {{LangSwitch|default=Examples|eo=Kiel uzi|ru=Применение}} ===
Line 65: Line 69:
*en:n {{W|Egyptian MP calls for web porn ban|3=en:n}}
*en:n {{W|Egyptian MP calls for web porn ban|3=en:n}}
*sv:v {{W|Surdegsbakning för hemmabagaren|3=sv:v}}
*sv:v {{W|Surdegsbakning för hemmabagaren|3=sv:v}}
----
<includeonly>
<includeonly>
[[Category:Interwiki link templates|{{PAGENAME}}]]
[[Category:Interwiki link templates|{{PAGENAME}}]]
</includeonly>
</includeonly>

Revision as of 14:50, 12 March 2014

This is used to help create interwiki links, without displaying the prefix, and without the need for repetition if the link text is the same as target page name.

  • The default prefix is simply w: which creates a link to the English Wikipedia. However the language can be specified in the third parameter.

Usage

{{W |1= |2= |3= }}

Template parameters

ParameterDescriptionDefaultStatus
1page name; also specific [sub]pages (e.g: user, category, talk, ...)main page of the wikirequired
2display textparameter #1optional
3language code (ISO 639), or sisterproject prefixenoptional
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.


Wikipedia's help about TemplateDataCommons-specific information

This is used to help create interwiki links, without displaying the prefix, and without the need for repetition if the link text is the same as target page name.

  • The default prefix is simply <tt>w:</tt> which creates a link to the English Wikipedia. However the language can be specified in the third parameter.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
1

page name; also specific [sub]pages (e.g: user, category, talk, ...)

Default
main page of the wiki
Unknownrequired
2

display text

Default
parameter #1
Unknownoptional
3

language code (ISO 639), or sisterproject prefix

Default
en
Unknownoptional

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.

Examples

All parameter combinations

000 {{W}} → Wikipedia [1]

003 {{W|3=es}} → Wikipedia [1]
003 {{W|3=pt}} → Wikipedia [1]

020 {{W||Main Page}} → Main Page
020 {{W||en:Main Page}} → en:Main Page

023 {{W||Ĉefpaĝo|eo}} → Ĉefpaĝo

100 {{W|Page name}} → Page name

103 {{W|Page name||it}} → Page name
103 {{W|Page name||fr}} → Page name

120 {{W|Page name|Display name}} → Display name

123 {{W|Page name|Display name|nl}} → Display name
123 {{W|Page name|Display name|hu}} → Display name

  1. 1.0 1.1 1.2 It is recommended to use parameter #2 giving an explaining text, as shown in the other Main Page examples


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