Template:Guardian topic/doc
| icon | This is a documentation subpage for Template:Guardian topic. It may contain usage information, categories and other content that is not part of the original template page. |
| File:Lua-Logo.svg | This template uses Lua: |
| File:Information icon4.svg | This template is intended for external links. It is not designed for use as a citation template for reliable sources. |
Template:Guardian topic generates an external link to a topic page at The Guardian website. It is intended for use in the external links section of an article.
Usage
[edit source]- Unnamed parameters
{{Guardian topic | ID }}{{Guardian topic | ID | NAME }}
- Named parameters
{{Guardian topic | id= ID }}{{Guardian topic | id= ID | name= NAME }}
Instructions
[edit source]Provide the URL path (after the first level) as the first parameter, and an optional name as the second parameter. If no ID is provided, the template will attempt to fetch the value from Wikidata. If no name is provided for the second parameter, the template will use the name of the Wikipedia article.
Examples
[edit source]One parameter
[edit source]- Usage
* {{Guardian topic | music/aretha-franklin }}* {{Guardian topic | id= music/aretha-franklin }}
- Output
-
- Guardian topic/doc collected news and commentary at The Guardian
Two parameters
[edit source]- Usage
* {{Guardian topic | us-news/bill-gates | Bill Gates }}* {{Guardian topic | id= us-news/bill-gates | name= Bill Gates }}
- Output
-
- Bill Gates collected news and commentary at The Guardian
No ID in template or Wikidata
[edit source]- Usage
* {{Guardian topic}}
- Output
-
- Guardian topic/doc collected news and commentary at The GuardianLua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
TemplateData
[edit source]TemplateData for Guardian topic
This template generates an external link to a topic page at The Guardian website. It is intended for use in the external links section of an article.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| ID | 1 id | The "id" parameter (or unnamed parameter "1") may be used to specify the ID portion of the URL. Example: music/aretha-franklin is the ID in https://www.theguardian.com/music/aretha-franklin. This parameter is optional if Wikidata property P3106 exists, but required if not.
| String | optional |
| Name | 2 name | The "name" parameter (or unnamed parameter "2") may be used to specify the topic name, which is displayed in the link text. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation.
| String | optional |
Tracking categories
[edit source]- ID parameter exists
- Category:Guardian topic ID not in Wikidata (5)
- Category:Guardian topic ID different from Wikidata (0)
- Category:Guardian topic ID same as Wikidata (23)
- ID parameter does not exist
- Category:Guardian topic template missing ID and not in Wikidata (1)
- Category:Guardian topic template using Wikidata (177)
See also
[edit source]- {{New York Times topic}} – topic page at The New York Times
- {{Bloomberg topic}} – topic page at Bloomberg News
- {{Aljazeera topic}} – topic page at Al Jazeera English