Template:Sports reference/doc: Difference between revisions
Tom.Reding (talk | contribs) m {{High-use}} |
merge templates, add link |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. --> |
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. --> |
||
{{Template redirect|sports-reference|Sports-Reference|SR/Olympics|SR/Olympics profile|Olympics at Sports-Reference.com}} |
{{Template redirect|sports-reference|Sports-Reference|SR/Olympics|SR/Olympics profile|Olympics at Sports-Reference.com}} |
||
{{ |
{{Tracks and uses Wikidata|P1447}} |
||
{{Tracks Wikidata|P1447}} |
|||
{{Lua|Module:Sports reference}} |
{{Lua|Module:Sports reference}} |
||
Line 19: | Line 18: | ||
If this results in an error, that means the article's [[Wikidata]] item does not have the property {{wpl|P1447}}. To resolve this, either [[#Add ID in Wikidata|add the "id" in Wikidata]] or use the optional "id" parameter in the template. For example, <kbd>'''da/bjorn-daehlie-1'''</kbd> is the "id" portion of the URL <kbd>https://<nowiki/>www.sports-reference.com/olympics/athletes/'''da/bjorn-daehlie-1'''.html</kbd>. |
If this results in an error, that means the article's [[Wikidata]] item does not have the property {{wpl|P1447}}. To resolve this, either [[#Add ID in Wikidata|add the "id" in Wikidata]] or use the optional "id" parameter in the template. For example, <kbd>'''da/bjorn-daehlie-1'''</kbd> is the "id" portion of the URL <kbd>https://<nowiki/>www.sports-reference.com/olympics/athletes/'''da/bjorn-daehlie-1'''.html</kbd>. |
||
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}| |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}|<var>ID</var><nowiki>}}</nowiki></code> |
||
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}|id= |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}|id=<var>ID</var><nowiki>}}</nowiki></code> |
||
The [[link text]] defaults to the Wikipedia article name, without any disambiguation such as "(athlete)". The default text can be changed via the optional "name" parameter. This may be useful when adding the template more than once (to differentiate the links) or when the article name is different than the athlete's name at Sports-Reference.com. |
The [[link text]] defaults to the Wikipedia article name, without any disambiguation such as "(athlete)". The default text can be changed via the optional "name" parameter. This may be useful when adding the template more than once (to differentiate the links) or when the article name is different than the athlete's name at Sports-Reference.com. |
||
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}| |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}|<var>ID</var>|<var>NAME</var><nowiki>}}</nowiki></code> |
||
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}|id= |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}|id=<var>ID</var>|name=<var>NAME</var><nowiki>}}</nowiki></code> |
||
== Examples == |
== Examples == |
||
=== ID in template === |
=== ID in template === |
||
; Usage in the article [[Jeremy Abbott]], with article name as link text |
|||
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | ab/jeremy-abbott-2 }}</code> |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | ab/jeremy-abbott-2 }}</code> |
||
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= ab/jeremy-abbott-2 | archive= 20161202194710 }}</code> |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= ab/jeremy-abbott-2 | archive= 20161202194710 }}</code> |
||
; Usage with name parameter as link text |
|||
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | ab/jeremy-abbott-2 | Jeremy Abbott }}</code> |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | ab/jeremy-abbott-2 | Jeremy Abbott }}</code> |
||
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= ab/jeremy-abbott-2 | name= Jeremy Abbott | archive= 20161202194710 }}</code> |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= ab/jeremy-abbott-2 | name= Jeremy Abbott | archive= 20161202194710 }}</code> |
||
; Output |
|||
:* {{{{BASEPAGENAME}} | ab/jeremy-abbott-2 | Jeremy Abbott }} |
:* {{{{BASEPAGENAME}} | ab/jeremy-abbott-2 | Jeremy Abbott }} |
||
:* {{{{BASEPAGENAME}} | id= ab/jeremy-abbott-2 | name= Jeremy Abbott | archive= 20161202194710 }} |
:* {{{{BASEPAGENAME}} | id= ab/jeremy-abbott-2 | name= Jeremy Abbott | archive= 20161202194710 }} |
||
; URL |
|||
: <kbd>https://<nowiki/>www.sports-reference.com/olympics/athletes/{{hilite|ab/jeremy-abbott-2}}.html</kbd> |
: <kbd>https://<nowiki/>www.sports-reference.com/olympics/athletes/{{hilite|ab/jeremy-abbott-2}}.html</kbd> |
||
=== ID in Wikidata === |
=== ID in Wikidata === |
||
; Usage in the article [[Bjørn Dæhlie]] |
|||
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code> |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code> |
||
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | name= Bjørn Dæhlie <nowiki>}}</nowiki></code> |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | name= Bjørn Dæhlie <nowiki>}}</nowiki></code> |
||
; Output |
|||
:* {{{{BASEPAGENAME}} | da/bjorn-daehlie-1 | Bjørn Dæhlie }} [[File:OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt=Edit this at Wikidata |link=https://www.wikidata.org/wiki/Q217505#P1447 |Edit this at Wikidata]] |
:* {{{{BASEPAGENAME}} | da/bjorn-daehlie-1 | Bjørn Dæhlie }} [[File:OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt=Edit this at Wikidata |link=https://www.wikidata.org/wiki/Q217505#P1447 |Edit this at Wikidata]] |
||
; URL |
|||
: <kbd>https://<nowiki/>www.sports-reference.com/olympics/athletes/{{hilite|da/bjorn-daehlie-1}}.html</kbd> |
: <kbd>https://<nowiki/>www.sports-reference.com/olympics/athletes/{{hilite|da/bjorn-daehlie-1}}.html</kbd> |
||
=== No ID in template or Wikidata === |
=== No ID in template or Wikidata === |
||
; Usage |
|||
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code> |
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code> |
||
; Output |
|||
:* {{ {{BASEPAGENAME}} }} |
:* {{ {{BASEPAGENAME}} }} |
||
Line 85: | Line 84: | ||
"label": "id", |
"label": "id", |
||
"aliases": ["1"], |
"aliases": ["1"], |
||
"description": "The |
"description": "The ID portion of the URL, such as ab/jeremy-abbott-2 in https://www.sports-reference.com/olympics/athletes/ab/jeremy-abbott-2.html This parameter is optional if Wikidata property P1447 exists, but required if not.", |
||
⚫ | |||
"type": "string", |
"type": "string", |
||
"required": false |
"required": false |
||
⚫ | |||
}, |
}, |
||
"name": { |
"name": { |
||
"label": "name", |
"label": "name", |
||
"aliases": ["2"], |
"aliases": ["2"], |
||
"description": "The |
"description": "The link text, which should be the name of the athlete. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as \"(athlete)\".", |
||
⚫ | |||
"type": "string", |
"type": "string", |
||
"required": false |
"required": false |
||
⚫ | |||
}, |
}, |
||
"archive": { |
"archive": { |
||
"label": "archive", |
"label": "archive", |
||
"description": " |
"description": "A number representing the date/time in an Internet Archive URL, such as 20161202194710 in https://web.archive.org/web/20161202194710/https://www.sports-reference.com/olympics/athletes/ab/jeremy-abbott-2.html, which is a archive of https://www.sports-reference.com/olympics/athletes/ab/jeremy-abbott-2.html on 2016-12-02 19:47:10.", |
||
"type": "number", |
"type": "number", |
||
"required": false |
"required": false |
||
Line 134: | Line 133: | ||
* {{tl|Footballstats}} for links at [[Pro-Football-Reference.com]] |
* {{tl|Footballstats}} for links at [[Pro-Football-Reference.com]] |
||
* {{tl|FBref player}} for links at [[FBref.com]] |
* {{tl|FBref player}} for links at [[FBref.com]] |
||
== External links == |
|||
* [https://web.archive.org/web/*/http://www.sports-reference.com/olympics/athletes/* List of archived pages at ''www.sports-reference.com/olympics/athletes/''] |
|||
<includeonly>{{Sandbox other|| |
<includeonly>{{Sandbox other|| |
Latest revision as of 07:25, 20 August 2024
This is a documentation subpage for Template:Sports reference. It may contain usage information, categories and other content that is not part of the original template page. |
This template is used on approximately 6,400 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
This template uses Lua: |
Template:Sports reference displays an external link to an Olympic athlete's profile at Olympics at Sports-Reference.com, also known as SR/Olympics. It is intended for use in the external links section of an article.
The link is archived since the Sports Reference Olympic site closed on 14 May 2020. The web archive defaults to Memento Project which searches multiple sites to find an archived link. The archive date defaults to 4 December 2016 because pages after that display incorrect output for extended characters. A specific archive at the Wayback Machine may be specified via the |archive=
parameter.
Usage
[edit]The basic way to use the template is to insert this:
* {{Sports reference}}
If this results in an error, that means the article's Wikidata item does not have the property Sports-Reference.com Olympic athlete ID (archived) (P1447). To resolve this, either add the "id" in Wikidata or use the optional "id" parameter in the template. For example, da/bjorn-daehlie-1 is the "id" portion of the URL https://www.sports-reference.com/olympics/athletes/da/bjorn-daehlie-1.html.
* {{Sports reference|ID}}
* {{Sports reference|id=ID}}
The link text defaults to the Wikipedia article name, without any disambiguation such as "(athlete)". The default text can be changed via the optional "name" parameter. This may be useful when adding the template more than once (to differentiate the links) or when the article name is different than the athlete's name at Sports-Reference.com.
* {{Sports reference|ID|NAME}}
* {{Sports reference|id=ID|name=NAME}}
Examples
[edit]ID in template
[edit]- Usage in the article Jeremy Abbott, with article name as link text
* {{Sports reference | ab/jeremy-abbott-2 }}
* {{Sports reference | id= ab/jeremy-abbott-2 | archive= 20161202194710 }}
- Usage with name parameter as link text
* {{Sports reference | ab/jeremy-abbott-2 | Jeremy Abbott }}
* {{Sports reference | id= ab/jeremy-abbott-2 | name= Jeremy Abbott | archive= 20161202194710 }}
- Output
-
- Jeremy Abbott at Olympics at Sports-Reference.com (archived)
- Jeremy Abbott at Olympics at Sports-Reference.com (archived)
- URL
- https://www.sports-reference.com/olympics/athletes/ab/jeremy-abbott-2.html
ID in Wikidata
[edit]- Usage in the article Bjørn Dæhlie
* {{Sports reference}}
* {{Sports reference | name= Bjørn Dæhlie }}
- Output
-
- Bjørn Dæhlie at Olympics at Sports-Reference.com (archived)
- URL
- https://www.sports-reference.com/olympics/athletes/da/bjorn-daehlie-1.html
No ID in template or Wikidata
[edit]- Usage
* {{Sports reference}}
- Output
-
- Sports-Reference template missing ID and not present in Wikidata. How do I fix this?
Add ID in Wikidata
[edit]- Find the athlete's ID on the Sports Reference website. To do this, search for the athlete here, and look at the URL. The ID is everything between
www.sports-reference.com/olympics/athletes/
and.html
, so forhttps://www.sports-reference.com/olympics/athletes/be/livio-berruti-1.html
, the ID isbe/livio-berruti-1
. - In order to add this to Wikidata:
- Click "Wikidata item" under "Tools" to the left of the article.
- Go to the bottom of the section called "Statements" (just above the one called "Wikipedia pages linked to this item")
- Click the bottom-most link called "[add]"
- Type in "Sports Reference" in the first box that appears, and click "Sports Reference ID" in the dropdown that appears
- In the next box, paste the ID (
be/livio-berruti-1
in the example above) and press enter - You're done! If you go back to the article and refresh it (maybe try to purge the page by adding
?action=purge
at the end of the URL), the link should work properly.
- If you find this process too cumbersome, you are always free to use the optional backup parameter instead.
TemplateData
[edit]TemplateData for Sports reference
This template displays an external link to an Olympic athlete's profile at Olympics at Sports-Reference.com, also known as SR/Olympics. It is intended for use in the external links section of an article.
Parameter | Description | Type | Status | |
---|---|---|---|---|
id | id 1 | The ID portion of the URL, such as ab/jeremy-abbott-2 in https://www.sports-reference.com/olympics/athletes/ab/jeremy-abbott-2.html This parameter is optional if Wikidata property P1447 exists, but required if not.
| String | optional |
name | name 2 | The link text, which should be the name of the athlete. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as "(athlete)".
| String | optional |
archive | archive | A number representing the date/time in an Internet Archive URL, such as 20161202194710 in https://web.archive.org/web/20161202194710/https://www.sports-reference.com/olympics/athletes/ab/jeremy-abbott-2.html, which is a archive of https://www.sports-reference.com/olympics/athletes/ab/jeremy-abbott-2.html on 2016-12-02 19:47:10. | Number | optional |
Tracking categories
[edit]- ID parameter exists
- Category:Sports-Reference template with ID different from Wikidata (6)
- Category:Sports-Reference template with ID not in Wikidata (0)
- ID parameter does not exist
See also
[edit]- {{Cite sports-reference}}, for links used in a reference
Other Olympics templates
[edit]- {{Olympedia}}, for non-archived links to Olympedia.org (source for Olympics at Sports-Reference pages)
- {{Olympics.com profile}}, for links to an athlete's profile at the International Olympic Committee website
- Category:Olympics external link templates (55)
Other Sports Reference templates
[edit]- {{Baseballstats}} and {{Baseball-reference manager}} for links at Baseball-Reference.com
- {{Basketballstats}} and {{Basketball-Reference NBA Recap}} for links at Basketball-Reference.com
- {{Ice hockey stats}} and {{Hockey-reference}} for links at Hockey-Reference.com
- {{Footballstats}} for links at Pro-Football-Reference.com
- {{FBref player}} for links at FBref.com
External links
[edit]