模板:W
[[w:|]]
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=
(必填) – 将要链接的维基百科条目标题。|2=
– 待显示的文字。缺省情况下等于|1=
。|lang=
– 所在维基百科的语言代码。本词典项目默认是zh
,中文(汉语)。
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.
举例
- 仅使用参数1 –
{{w|The History of the Decline and Fall of the Roman Empire}}
生成: The History of the Decline and Fall of the Roman Empire - 同时使用参数1和参数2 –
{{w|William Shakespeare|Shakespeare}}
生成: Shakespeare - 也使用参数lang –
{{w|William Shakespeare|Shakespeare|lang=fr}}
生成: Shakespeare (linking to the French Wikipedia article)
说明
Because of its simplicity, the template can be substituted using subst:
However, substituting {{subst:w|The History of the Decline and Fall of the Roman Empire}}
gives an unwieldy 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]]
模板数据
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. There is a similar one without any mandatory parameter {{wikipedia}}
参数 | 描述 | 类型 | 状态 | |
---|---|---|---|---|
article | 1 | Page to link on Wikipedia
| 单行文本 | 必需 |
label | 2 | Text displayed on the link
| 单行文本 | 推荐 |
language code | lang | the ISO language code of the target Wikipedia.
| 字符串 | 可选 |