模板:OpenSecrets
跳至導覽
跳至搜尋
File:Test Template Info-Icon - Version (2).svg 模板文件[檢視] [編輯] [歷史] [清除快取]
| File:Lua-Logo.svg | 此模板使用Lua語言: |
Template:OpenSecrets displays an external link to a page at OpenSecrets, a website that tracks and publishes data on campaign finance and lobbying. It is intended for use in the external links section of an article.
Usage[編輯]
- Unnamed parameters
{{OpenSecrets | user name or number }}{{OpenSecrets | user name or number | Displayed Name }}
- Named parameters
{{OpenSecrets | id= user name or number }}{{OpenSecrets | id= user name or number | name= Displayed Name }}
- Using Wikidata property
{{OpenSecrets}}{{OpenSecrets | name= Displayed Name }}
Examples[編輯]
Linking to a profile or page[編輯]
In this example, the OpenSecrets ID is d000067823 and the link text is Alphabet Inc.:
- https://www.opensecrets.org/orgs/summary?id=d000067823
* {{OpenSecrets | d000067823 | Alphabet Inc. }}
Using Wikidata[編輯]
Generally, Wikidata should contain article subjects' OpenSecrets IDs in property 未安裝 Extension:Wikibase ?, allowing the ID parameter to be omitted:
* {{OpenSecrets}}* {{OpenSecrets |name=NAME }}
If the Wikidata property is not defined, the output is:
- OpenSecrets在OpenSecrets上的數據Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
TemplateData[編輯]
<templatedata> {
"description": "Generate a link to a OpenSecrets profile in a standard format.",
"params": {
"id": {
"label": "Account ID",
"aliases": ["1"],
"description": "ID of the OpenSecrets account (part of the web page address, for www.OpenSecrets.com/example/ the account id is \"example\"). This parameter is optional if Wikidata property P4691 exists, but required if not.",
"default": "Wikidata property P4691",
"example": "d000067823",
"type": "string/line",
"required": false
},
"name": {
"label": "Display name",
"aliases": ["2"],
"description": "Display name for the OpenSecrets account",
"default": "Name of the page",
"example": "Alphabet Inc.",
"type": "string/line",
"required": false
}
}
} </templatedata>
See also[編輯]
- {{OpenSecrets}} which uses Wikidata property 未安裝 Extension:Wikibase ?
- OpenSecrets