This page is protected against editing.

Template:W

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Wikipedia

Protected This template has been protected from editing to prevent vandalism.
Please discuss changes on the talk page or request unprotection.
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:W/doc.

This template is used to help create interwiki links without displaying the prefix, and without the need for repetition if the page name is to display; in this case understroke characters in the page name are replaced by space characters.

  • The default template name is simply W which creates a link to the English Wikipedia.
  • However any language code instead of en can be specified in the third parameter.

Usage

{{W |1= }}

Template parameters

ParameterDescriptionDefaultStatus
1Page NameAlso specific [sub]pages or name spaces as user, category, talk ...main page of the wikisuggested
2Display Text{{{1}}}optional
3Interwiki Prefixlanguage code (ISO 639-1), and/or sisterproject prefixenoptional
linkcan change the intended usage of the template to create a link:
  • link=no, link=n, link=- or just link=: returns parameter 2 or 1 as plain text instead of the link
may be useful when the thought page does not (yet) exist
  • link=none: no transclusion - does nothing (the whole usage of the template is useless)
  • any other value: is displayed as-it-is; may be a link ({{...}}, [[...]]) or not.
emptyoptional
Template data
<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.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

This template is used to help create interwiki links without displaying the prefix, and without the need for [[User talk:Perhelion/simpleSVGcheck.js#Link templates|repetition]] if the page name is to display; in this case understroke characters in the page name are ''replaced'' by space characters.

  • <span style="font-weight:normal">The default template name is simply [[:Template:W|W]] which creates a link to the [[:w:|English Wikipedia]].</span>
  • <span style="font-weight:normal">However any language code instead of <code>en</code> can be specified in the third parameter.</span>

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Page Name1

Also specific [sub]pages or ''name spaces'' as user, category, talk ...

Default
main page of the wiki
Page namesuggested
Display Text2

Default
{{{1}}}
Lineoptional
Interwiki Prefix3

language code (ISO 639), and/or sisterproject prefix

Default
en
Stringoptional
link

can change the intended usage of the template to create a link:

  • <code>link=no</code>, <code>link=n</code>, <code>link=-</code> or just <code>link=</code>: returns parameter 2 or 1 as plain text instead of the link
  • may be useful when the thought page does not (yet) exist
    • <code>link=none</code>: no transclusion - does nothing (the whole usage of the template is useless)
    • any other value: is displayed as-it-is; may be a link ({{...}}, [[...]]) or not.

      Auto value
      no
    Stringoptional

    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

    See also

    {{Ud}} and other Interwiki link templates;


    {{WA}} or {{وك}} links to ar:العربية
    {{Wb}} links to bn:Wikipedia
    {{Wc}} links to cs:Wikipedie
    {{WC}} links to ca:Viquipèdia
    {{Wd}} links to de:Wikipedia
    {{We}} links to es:Wikipedia
    {{Wet}} links to et:Vikipeedia
    {{Wf}} links to fr:Wikipédia
    {{Wfa}} links to fa:ویکی‌پدیا
    {{Wg}} links to gl:Wikipedia
    {{Wh}} links to hu:Wikipédiá
    {{Whe}} links to he:ויקיפדיה
    {{Whi}} links to hi:विकिपीडिया
    {{Wi}} links to it:Wikipedia
    {{Wid}} links to id:Wikipedia
    {{W}} or {{Wja}} links to ja:ウィキペディア
    {{ವಿ}} links to kn:ವಿಕಿಪೀಡಿಯ
    {{W말}} or {{Wko}} links to ko:위키백과
    {{വി}} links to ml:വിക്കിപീടിയ
    {{Wlt}} links to lt:Wikipedia
    {{Wlv}} links to lv:Wikipedia
    {{Wm}} links to mk:Википедија
    {{Wn}} links to nl:Wikipedia
    {{Wp}} links to pt:Wikipédia
    {{WP}} links to pl:Wikipedia
    {{Wr}} links to ru:Википедия
    {{වි}} links to si:විකිපීඩියා
    {{Wsk}} links to sk:Wikipédia
    {{Wsl}} links to sl:Wikipedija
    {{Wsu}} links to su:Wikipédia
    {{Wsv}} links to sv:Wikipedia
    {{Wth}} or {{ว}} links to th:วิกิพีเดีย
    {{Wtr}} links to tr:Vikipedi
    {{Wu}} links to uk:Вікіпедія
    {{Wz}} links to zh:維基百科

    The "W××" templates are shortcuts of the main template {{W}}, setting the language code with parameter 3: {{ W××link }} is just {{ Wlink3 = ×× }}
    the "W×" templates are abbreviated shortcuts for some very often used languages.

    More W× templates are elsewhere in use:
    but there are no other language codes starting with "w", so plenty of "W×" templates may be created.

    Localization

    This template is not intended to be localized.

    Recommendation

    For linking to a sister project, an internal link such as {{W||en.wikipedia}}) is preferred over an external one (e.g. [http://en.wikipedia.org en.wikipedia]).

    Examples

    All parameter combinations

    Numbers at line beginning indicate parameter use (0=parameter without value)

    000 {{W}}Wikipedia [1]
    003 {{W|3=es}}Wikipedia [1] Arrow facing left - Green.svg {{We}}: {{ We }} → es:Wp
    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
    023 {{W||pt:Wikipedia|pt}}pt:Wikipedia Arrow facing left - Green.svg {{Wp}}: {{ Wp }} → pt:Wp
    023 {{W||pt:Wp|pt}}pt:Wp (preferred style of a link to a national mainpage)
    023 {{W||de:Wp|de}}de:Wp Arrow facing left - Green.svg {{Wd}}: {{ Wd }} → de:Wp
    100 {{W|Page name}}Page name
    103 {{W|Page name||it}}Page name Arrow facing left - Green.svg {{Wi}}: {{ Wi }} → it:Wp
    103 {{W|Page name||fr}}Page name Arrow facing left - Green.svg {{Wf}}: {{ Wf }} → fr:Wp
    103 {{W|{{FULLPAGENAME}}|3=pl}}Template:W
    120 {{W|Page name|Display name}}Display name
    123 {{W|Page name|Display name|nl}}Display name Arrow facing left - Green.svg {{Wn}}: {{ Wn }} → nl:Wp
    123 {{W|Page name|Display name|hu}}Display name Arrow facing left - Green.svg {{Wh}}: {{ Wh }} → hu:Wp
    1. a b c It is recommended to use parameter #2 giving an explaining text, as shown in the “023” Main Page examples.


    Complex page name examples
    3=de de:Wikipedia Benutzer Diskussion:Andreas 06/Spielwiese/Stadien der Fußball-Bundesliga
    3=fr fr:Wikipédia Discussion aide:Catégorie/Archive3
    3=yi yi:Wikipedia ענדערן הילף:אינהאלט
    3=pt pt:Wikipedia Categoria:Cidades fantasmas da CalifórniaPredefinição Discussão:!Info pessoal
    3= en:Wikipedia Template talk:Welcome/fr
    3=nl:b nl:Wikibooks Scalable Vector Graphics/Stijl
    3=en:d en:Wikidata Project chat
    3=en:n en:Wikinews Egyptian MP calls for web porn ban
    3=fi:q fi:Wikiquote Elizabeth II
    3=es:s es:Wikisource Archivo:Las Maravillas Del Cielo pg 7.jpg
    3=sv:v sv:Wikiversity Surdegsbakning för hemmabagaren
    3=pl:voy pl:Wikivoyage San Francisco
    3=lt:wikt lt:Wiktionary Sąrašas:Kinų hieroglifų raktai
    3=d 00 Wikidata Property:P4896
    3=m 00 Metawiki VisualEditor/Newsletter/2014/November/ka
    3=mw 00 Mediawiki Extension:ParserFunctions/it
    3=species 0Wikispecies Verrucaria halizoa
    3=en:commons en:Commons Template:W

    [edit subpage]

    General Interwiki link

    Template {{W}} - examples short Result links to
    {{w||en:WP}} {{W}} en:WP en:Main page
    {{w|Braille#Lletres i nombres||ca)}} Braille ca:article page
    {{w|template:Commonscat||de}} {{Wd|template:Commonscat}} Template:Commonscat de:Vorlage:Commonscat
    {{w|category:Liste d'artistes||fr}} {{Wf|category:Liste d'artistes}} Category:Liste d'artistes fr:Catégorie:Liste d'artistes
    {{w|file:Coverkill.jpg||pt}} {{Wp|file:Coverkill.jpg}} File:Coverkill.jpg pt:Ficheiro:Coverkill.jpg
    {{w|user:Feketetomi||hu}} {{Wh|user:Feketetomi}} User:Feketetomi hu:Szerkesztő:Feketetomi
    {{w|talk:Merano#Rino Gaetano e Merano|3=it)}} {{Wi|talk:Merano#Rino Gaetano e Merano)}} Talk:Merano it:Discussione:Merano
    {{w|Carnivora||wikispecies)}} {{W|Carnivora||species)}} Carnivora Wikispecies:Carnivora

    In all Wikis, the English namespaces (e.g. file, user) work as well as the different national ones.