Template:w

Definition from Wiktionary, the free dictionary
Jump to navigation Jump to search

[[wikipedia:|]]


This template is for having shorter links to an English Wikipedia article when the link is identical to its label. It takes the following parameters:

  • |1= (required) — the page title on Wikipedia to which you wish to link
  • |2= — the text that the template displays. Default is the value entered in |1=
  • |lang= — the ISO language code of the target Wikipedia. Default is en, for English.

A similar effect can be accomplished using the pipe trick: [[w:Chicken|]] is converted to [[w:Chicken|Chicken]] during the pre-save transform, which renders as Chicken. Only one interwiki prefix can be stripped in this way. [[w:fr:Académie française|]] transforms to [[w:fr:Académie française|fr:Académie française]].

See also Template:Wikipedia, which inserts a box with a link to the Wikipedia article, and has no required parameters.

Examples

  • using parameters 1 and 2 — {{w|William Shakespeare|Shakespeare}} gives: Shakespeare
  • also using parameter lang — {{w|William Shakespeare|Shakespeare|lang=fr}} gives: Shakespeare (linking to the French Wikipedia article)

Notes

Because of its simplicity, the template can be substituted using subst:

  • {{subst:w|William Shakespeare|Shakespeare}} gives: [[w:William Shakespeare|Shakespeare]]

However, substituting {{subst:w|The History of the Decline and Fall of the Roman Empire}} gives an unwiedly duplication of content the template is here to avoid in the first place: [[w:The History of the Decline and Fall of the Roman Empire|The History of the Decline and Fall of the Roman Empire]]

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools.

TemplateData for w

This template is for having shorter links to an English Wikipedia article when the link is identical to its label. It had one mandatory parameter.

[Edit template data]

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
article1

Page to link on Wikipedia

Example
Cursive script (East Asia)
Linerequired
label2

Text displayed on the link

Example
cursive script
Linesuggested
language codelang

the ISO language code of the target Wikipedia.

Default
en
Example
es
Stringoptional