跳转到内容

模板:EditAtWikidata/doc

来自代码酷
*>SWinxy2024年11月13日 (三) 04:58的版本 (add suppression example)

(差异) ←上一版本 | 已核准修订 (差异) | 最后版本 (差异) | 下一版本→ (差异)

Template to display an icon with a tooltip such as "Edit this at Wikidata".

  • Icon will be linked to the Wikidata entry for the article where this is placed.
  • The link can be modified to point to a specific property (or part thereof) in the Wikidata entry by supplying the optional named parameter |pid=.
  • This message is only displayed if parameter |1=} is empty; i.e. when called from within a template, it can be coded not to display the icon, which means the value from Wikidata is not used.
  • The Wikidata ID can optionally be supplied for testing outside the article (this is an expensive call).

Usage

  • {{EditAtWikidata}}

Outside the article:

  • {{EditAtWikidata |qid=<Qid of article at Wikidata>}}

Inside another template:

  • {{EditAtWikidata |{{{local_parameter|}}} }}

To make the link point to the given propertyID at the Wikidata entry:

  • {{EditAtWikidata |pid=<PropertyID> |local_parameter}}

Example

Wikitext Output
With no parameters:
{{EditAtWikidata}}
模块:EditAtWikidata第29行Lua错误:attempt to index field 'wikibase' (a nil value)
Linking to a different Wikidata item:
{{EditAtWikidata|qid=Q42}}
模块:EditAtWikidata第30行Lua错误:attempt to index field 'wikibase' (a nil value)
Linking to a specific property in an item:
{{EditAtWikidata|qid=Q42|pid=P735}}
模块:EditAtWikidata第30行Lua错误:attempt to index field 'wikibase' (a nil value)
Suppressing the edit link:
{{EditAtWikidata|value}}

TemplateData

Link to an item on Wikidata, with a tooltip such as "Edit this at Wikidata".

模板参数

此模板首选参数不换行的行内格式。

参数描述类型状态
Property or claim IDpid

ID of the property to be edited at Wikidata. Can also be a 'claim ID', to link to a particular value within a property (when there are multiple).

示例值
P1082
字符串推荐
Non-breaking spacenbsp

Replaces the leading space with a non-breaking space

自动值
yes
布尔可选
Hide the edit-at-Wikidata link?1

To prevent display of the Wikidata link. Useful for templates that add local overrides.

布尔可选
Item IDqid

ID (Q-number) of the item to be edited at Wikidata.

默认值
ID of the current page.
示例值
Q42
字符串可选

See also