Template:W: Difference between revisions
More actions
Prefix interwiki language codes with w: (resolve to en.wikipedia) Tag: Reverted |
Fix interwiki prefix normalization in W template Tag: Reverted |
||
| Line 2: | Line 2: | ||
-->|{{#switch:{{{link|}}}|none=<!-- | -->|{{#switch:{{{link|}}}|none=<!-- | ||
-->|no|n|-|={{#if:{{{2|}}}|{{#switch:{{{2}}}|+|c={{{1}}}|{{{2}}}}}|{{{1|{{Projectname|w}}}}}}}<!-- option for only text without link | -->|no|n|-|={{#if:{{{2|}}}|{{#switch:{{{2}}}|+|c={{{1}}}|{{{2}}}}}|{{{1|{{Projectname|w}}}}}}}<!-- option for only text without link | ||
-->|=[[:w:{{# | -->|=[[:w:{{#switch:{{lc:{{{3|w}}}}}|w|en|+|c|#default={{lc:{{{3}}}}}:}}}}:{{{1|{{Projectname|w}}}}}<!-- (w=en) | ||
-->|{{<includeonly>safesubst:</includeonly>#if:{{{2|}}}|{{#switch:{{{2}}}|+|c={{{1}}}|{{{2}}}}}|{{{1|{{Projectname|w}}}}}<!-- | -->|{{<includeonly>safesubst:</includeonly>#if:{{{2|}}}|{{#switch:{{{2}}}|+|c={{{1}}}|{{{2}}}}}|{{{1|{{Projectname|w}}}}}<!-- | ||
Revision as of 19:32, 11 August 2026
[[:w:{{{3}}}:}}:Wikipedia|Wikipedia]]
This template is used to help create interwiki links without displaying the prefix, and without the need for repetition if the same page name is to display; understroke characters in the page name are replaced by space characters.
- The default template name is simply
Wwhich creates a link to the [[:w:{{{3}}}:}}:|English Wikipedia]].
- However any [[:w:{{{3}}}:}}:List of ISO 639-1 codes|language code]] (>400 templates) instead of
encan be specified in the third parameter.
- However any [[:w:{{{3}}}:}}:List of ISO 639-1 codes|language code]] (>400 templates) instead of
It is also possible to categorize using the (first or second) parameter.
Usage
{{W |1= }}
- Wikipedia
- wikipedia
- wp
- w
- Wiktionary
- wiktionary
- wikt
- Wikiquote
- wikiquote
- wq
- q
- Wikisource
- wikisource
- ws
- s
- Wikibooks
- wikibooks
- wb
- b
- Wikiversity
- wikiversity
- wv
- v
- Wikispecies
- wikispecies
- species
- wsp
- Wikinews
- wikinews
- wn
- n
- Wikivoyage
- wikivoyage
- voy
- Wikidata
- wikidata
- wd
- d
- Wikimedia Commons
- commons
- c
- Wikifunctions
- wikifunctions
- func
- f
- Meta-Wiki
- meta
- m
- metawiki
- metawikimedia
- metawikipedia
- Wikimedia Incubator
- incubator
- inc
- Wikimedia Outreach
- outreach
- outreachwiki
- Wikimedia Foundation
- foundation
- wmf
- wikimedia
- MediaWiki.org
- mediawikiwiki
- mw
- mediawiki
- Wikitech
- wikitech
- labsconsole
- Wikimedia Strategy
- strategy
- Wikimedia Quality
- quality
- SUL util
- sulutil
- Stewards' noticeboard / spcom
- spcom
- Toolforge
- toolforge
- toollabs
- Phabricator
- phabricator
- phab
- bugzilla
- mediazilla
- Wikimania
- wikimania
- wmania
- wm
- Wikimania 2012
- wikimania2012
- wm2012
- Wikimania 2013
- wikimania2013
- wm2013
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | Page Name | Also specific [sub]pages or name spaces as user, category, talk ... | main page of the wiki | suggested |
2 | Display Text | {{{1}}} | optional | |
3 | Interwiki Prefix | language code ([[:w:{{{3}}}:}}:List of ISO 639-1 codes|ISO 639-1]]), and/or sisterproject prefix | en | optional |
4 | category request | + or c: categorizes using parameter 1 ("+" or "c" can also be specified with parm 2 or 3) C: categorizes using parameter 2 (only when it exists; "C" can also be specified with parm 3); c and C enables modification of the parameter | empty | optional |
link | link option | can change the intended usage of the template to create a link:
| empty | optional |
|
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
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 Newly created template documentation and imports Wikipedia's help about TemplateData • Commons-specific information This template is used to help create interwiki links without displaying the prefix, <span style="font-weight:normal">and without the need for [[User talk:Perhelion/simpleSVGcheck.js#Link templates|repetition]] if the same page name is to display; understroke characters in the page name are ''replaced'' by space characters.</span>
| ||||||||||||||||||||||||||||||
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 [[:w:ar:}}:|ar:العربية]]
{{Wb}} links to [[:w:bn:}}:|bn:Wikipedia]]
{{Wc}} links to [[:w:cs:}}:|cs:Wikipedie]]
{{WC}} links to [[:w:ca:}}:|ca:Viquipèdia]]
{{Wd}} links to [[:w:de:}}:|de:Wikipedia]]
{{Wda}} links to [[:w:da:}}:|da:Wikipedia]]
{{We}} links to [[:w:es:}}:|es:Wikipedia]]
{{Wet}} links to [[:w:et:}}:|et:Vikipeedia]]
{{Weu}} links to [[:w:eu:}}:|eu:Wikipedia]]
{{WE}} links to [[:w:eo:}}:|eo:Wikipedia]]
{{Wf}} links to [[:w:fr:}}:|fr:Wikipédia]]
{{Wfa}} links to [[:w:fa:}}:|fa:ویکیپدیا]]
{{Wfi}} links to [[:w:fi:}}:|fi:Wikipedia]]
{{Wg}} links to [[:w:gl:}}:|gl:Wikipedia]]
{{Wh}} links to [[:w:hu:}}:|hu:Wikipédia]]
{{Whe}} links to [[:w:he:}}:|he:ויקיפדיה]]
{{Whi}} links to [[:w:hi:}}:|hi:विकिपीडिया]]
{{Wi}} links to [[:w:it:}}:|it:Wikipedia]]
{{Wid}} links to [[:w:id:}}:|id:Wikipedia]]
{{Wja}} or {{W日}} links to [[:w:ja:}}:|ja:ウィキペディア]]
{{Wka}} links to [[:w:ka:}}:|ka:ვიკიპედია]]
{{ವಿ}} links to [[:w:kn:}}:|kn:ವಿಕಿಪೀಡಿಯ]]
{{Wko}} or {{W말}} links to [[:w:ko:}}:|ko:위키백과]]
{{Wky}} links to [[:w:ky:}}:|ky:Википедия]]
{{വി}} links to [[:w:ml:}}:|ml:വിക്കിപീഡിയ]]
{{Wlt}} links to [[:w:lt:}}:|lt:Vikipedija]]
{{Wlv}} links to [[:w:lv:}}:|lv:Vikipēdija]]
{{Wm}} links to [[:w:mk:}}:|mk:Википедија]]
{{Wn}} links to [[:w:nl:}}:|nl:Wikipedia]]
{{Wp}} links to [[:w:pt:}}:|pt:Wikipédia]]
{{WP}} links to [[:w:pl:}}:|pl:Wikipedia]]
{{Wr}} links to [[:w:ru:}}:|ru:Википедия]]
{{වි}} links to [[:w:sl:}}:|si:විකිපීඩියා]]
{{Wsk}} links to [[:w:sk:}}:|sk:Wikipédia]]
{{Wsl}} links to [[:w:sl:}}:|sl:Wikipedija]]
{{Wsr}} links to [[:w:sr:}}:|sr:Википедија]]
{{Wsu}} links to [[:w:su:}}:|su:Wikipédia]]
{{Wsv}} links to [[:w:sv:}}:|sv:Wikipedia]]
{{Wth}} or {{ว}} links to [[:w:{{{3}}}:}}:|th:วิกิพีเดีย]]
{{Wtr}} links to [[:w:tr:}}:|tr:Vikipedi]]
{{Wu}} links to [[:w:uk:}}:|uk:Вікіпедія]]
{{Wz}} links to [[:w:zh:}}:|zh:維基百科]]
The "W××" templates are shortcuts of the main template {{W}}, setting the language code with parameter 3: {{ W×× | link }} is just {{ W | link | 3 = ×× }}
the "W×" templates are abbreviated shortcuts for some very often used languages.
- More W× templates are elsewhere in use:
- {{Wso}} links to Wikisource
- {{Ws}} for a linkbox to Wikispecies, {{WS}} to WikispeciesCompact,
- {{Wt}} for the link to Wiktionary,
- {{Wa}} for [[:w:{{{3}}}:}}:Walloon language|Walloon language]], {{Wo}} for [[:w:{{{3}}}:}}:Wolof language|Wolof language]], and {{War}} and {{Wuu}}.
- but there are no other [[:w:{{{3}}}:}}:List of ISO 639-1 codes|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 as e.g. [http://en.wikipedia.org en.wikipedia].
Category option
Very often one (or more) of the names linked with a W-template are also used for categorizing. As a simplification, the W-template can care for both: the page name or the display text of the Template:W can be also used for this categorizing, by just adding the parameter "+", "c" or "C".
- Modification of the "cat" parameter:
When it is not the correct category name, it can be modified:
- with "+=" a number of characters can be specified to strip on the left of the parameter,
- with "-=" to strip from the end of the parameter.
- To perform the "+" and/or "-" stripping a module is invoked. When no (+/-)-stripping is needed, use '+' instead of 'c' for less effort.
- With "h=" or "t=" text can be specified to prefix and/or trail the parameter.
Example: {{W|Toronto|+}} categorizes to Toronto;
{{W|Toronto|+|t=_in_art}} categorizes to Toronto in art
Examples
- All parameter combinations
Numbers at line beginning indicate parameter use (0=parameter without value)
- 000
{{W}}→ [[:w:{{{3}}}:}}:Wikipedia|Wikipedia]] [1]
- 003
{{W|3=es}}→ [[:w:es:}}:Wikipedia|Wikipedia]] [1]{{We}}: {{ We }} → [[:w:es:}}:Wikipedia|es:Wp]]
- 003
{{W|3=pt}}→ [[:w:pt:}}:Wikipedia|Wikipedia]] [1]
- 020
{{W||Main Page}}→ [[:w:{{{3}}}:}}:|Main Page]] - 020
{{W||en:Main Page}}→ [[:w:{{{3}}}:}}:|en:Main Page]]
- 023
{{W||Ĉefpaĝo|eo}}→ [[:w:eo:}}:|Ĉefpaĝo]] - 023
{{W||pt:Wikipedia|pt}}→ [[:w:pt:}}:|pt:Wikipedia]]{{Wp}}: {{ Wp }} → [[:w:pt:}}:Wikipédia|pt:Wp]]
- 023
{{W||pt:Wp|pt}}→ [[:w:pt:}}:|pt:Wp]] (preferred style of a link to a national mainpage) - 023
{{W||de:Wp|de}}→ [[:w:de:}}:|de:Wp]]{{Wd}}: {{ Wd }} → [[:w:de:}}:Wikipedia|de:Wp]]
- 100
{{W|Page name}}→ [[:w:{{{3}}}:}}:Page name|Page name]] - 100
{{Wf|Paris|c}}→ [[:w:fr:}}:Paris|Paris]] +[[Category:Paris]]
- 103
{{W|Page name||it}}→ [[:w:it:}}:Page name|Page name]]{{Wi}}: {{ Wi }} → [[:w:it:}}:Wikipedia|it:Wp]]
- 103
{{W|Page name||fr}}→ [[:w:fr:}}:Page name|Page name]]{{Wf}}: {{ Wf }} → [[:w:fr:}}:Wikipédia|fr:Wp]]
- 103
{{W|{{FULLPAGENAME}}|3=pl}}→ [[:w:pl:}}:Template:W|Template:W]]
- 120
{{W|Page name|Display name}}→ [[:w:{{{3}}}:}}:Page name|Display name]]
- 123
{{W|Page name|Display name|nl}}→ [[:w:nl:}}:Page name|Display name]]{{Wn}}: {{ Wn }} → [[:w:nl:}}:Wikipédia|nl:Wp]]
- 123
{{W|Page name|Display name|hu}}→ [[:w:hu:}}:Page name|Display name]]{{Wh}}: {{ Wh }} → [[:w:hu:}}:Wikipédia|hu:Wp]]
- Complex page name examples
| 3=de | de:Wikipedia | [[:w:de:}}:Benutzer Diskussion:Andreas_06/Spielwiese/Stadien_der_Fußball-Bundesliga|Benutzer Diskussion:Andreas_06/Spielwiese/Stadien_der_Fußball-Bundesliga]] |
| 3=fr | fr:Wikipédia | [[:w:fr:}}:Discussion aide:Catégorie/Archive3#Appels à volontaires pour Aide à la conception de l'arborescence|Discussion aide:Catégorie/Archive3#Appels à volontaires pour Aide à la conception de l'arborescence]] |
| 3=yi | yi:Wikipedia | [[:w:yi:}}:ענדערן הילף:אינהאלט|ענדערן הילף:אינהאלט]] |
| 3=pt | pt:Wikipedia | [[:w:pt:}}:Categoria:Cidades fantasmas da Califórnia|Categoria:Cidades fantasmas da Califórnia]] • [[:w:pt:}}:Predefinição Discussão:!Info pessoal|Predefinição Discussão:!Info pessoal]] |
| 3= | en:Wikipedia | [[:w:{{{3}}}:}}:Template talk:Welcome/fr#Pas assez informatif|Template talk:Welcome/fr#Pas assez informatif]] |
| 3=nl:b | nl:Wikibooks | [[:w:nl:b:}}:Scalable Vector Graphics/Stijl|Scalable Vector Graphics/Stijl]] |
| 3=en:d | en:Wikidata | [[:w:en:d:}}:Project chat|Project chat]] |
| 3=en:n | en:Wikinews | [[:w:en:n:}}:Egyptian MP calls for web porn ban|Egyptian MP calls for web porn ban]] |
| 3=fi:q | fi:Wikiquote | [[:w:fi:q:}}:Elizabeth II|Elizabeth II]] |
| 3=es:s | es:Wikisource | [[:w:es:s:}}:Archivo:Las Maravillas Del Cielo pg 7.jpg|Archivo:Las Maravillas Del Cielo pg 7.jpg]] |
| 3=sv:v | sv:Wikiversity | [[:w:sv:v:}}:Surdegsbakning för hemmabagaren|Surdegsbakning för hemmabagaren]] |
| 3=pl:voy | pl:Wikivoyage | [[:w:pl:voy:}}:San Francisco|San Francisco]] |
| 3=lt:wikt | lt:Wiktionary | [[:w:lt:wikt:}}:Sąrašas:Kinų hieroglifų raktai|Sąrašas:Kinų hieroglifų raktai]] |
| 3=d | Wikidata | [[:w:d:}}:Property:P4896|Property:P4896]] |
| 3=m | Metawiki | [[:w:m:}}:VisualEditor/Newsletter/2014/November/ka|VisualEditor/Newsletter/2014/November/ka]] |
| 3=m:de | de:Metawiki | [[:w:m:de:}}:Sulzbach an der Murr|Sulzbach an der Murr]] |
| 3=mw | Mediawiki | [[:w:mw:}}:Extension:ParserFunctions/it|Extension:ParserFunctions/it]] |
| 3=species | Wikispecies | [[:w:species:}}:Verrucaria halizoa|Verrucaria halizoa]] |
| 3=en:commons | en:Commons | [[:w:en:commons:}}:Template:W|Template:W]] |
{{Commons:Link templates/Interwiki links}}