模板: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.
| 字串 | 非必填 |