Jump to content

Template:Association of Tennis Professionals link/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
See also: Added DavisCup player
update examples
(24 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{Tracks and uses Wikidata|P536}}
{{Lua|Module:EditAtWikidata|Module:WikidataCheck}}
{{High-use}}
{{tsh|ATP}}


'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a player's profile at the [[Association of Tennis Professionals]] (ATP) website.
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a tennis player's profile at [https://www.atptour.com/ ATPtour.com] (formerly [https://www.atpworldtour.com/ ATPworldtour.com]), the official website of the [[Association of Tennis Professionals]] (ATP). It is intended for use in the [[Wikipedia:External links|external links]] section of an article.


== Usage ==
== Usage ==
; Unnamed parameters
One parameter:
: {{tlcw|ATP | <var>ID</var> }}
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
: {{tlcw|ATP | <var>ID</var> | <var>NAME</var> }}
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' }}</code>


Two parameters:
; Named parameters
: {{tlcw|ATP | id{{=}} <var>ID</var> }}
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''NAME'' }}</code>
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
: {{tlcw|ATP | id{{=}} <var>ID</var> | name{{=}} <var>NAME</var> }}


; Using [[Wikidata]] property [[d:Property:P536|P536]]
== TemplateData ==
: {{tlcw|ATP}}
{{TemplateDataHeader}}
: {{tlcw|ATP | name{{=}} <var>NAME</var> }}
<templatedata>

{
== Examples ==
"description": "This template displays an external link to a player's profile at the Association of Tennis Professionals (ATP) website.",

"params": {
=== ID in template ===
"1": {
; Usage in the article [[Andre Agassi]], with article name as link text
"label": "ID",
: {{tlcw|a=1|ATP | a092 }}
"aliases": ["id"],
: {{tlcw|a=1|ATP | id{{=}} a092 }}
"description": "Identification string in the URL. Example: A092 is the ID number in http://www.atpworldtour.com/Tennis/Players/A092.aspx",

"type": "string",
; Usage with name parameter as link text
"default": "",
: {{tlcw|a=1|ATP | a092 | Andre Agassi }}
"required": true
: {{tlcw|a=1|ATP | id{{=}} a092 | name{{=}} Andre Agassi }}
},

"2": {
; Output
"label": "Name",
:* {{ATP | a092 | Andre Agassi }}
"aliases": ["name"],

"description": "Name to be displayed in the link text. If not given it defaults to the Wikipedia article name, without any disambiguation such as (tennis).",
; Current URLs
"type": "string",
: <kbd>[https://www.atptour.com/en/players/andre-agassi/a092/overview https://www.atptour.com/en/players/andre-agassi/{{highlight|a092}}/overview]</kbd>
"default": "{{PAGENAMEBASE}}",
: <kbd>[https://www.atptour.com/en/players/-/a092/overview https://www.atptour.com/en/players/-/{{highlight|a092}}/overview]</kbd>
"required": false

}
; Former URLs
}
: <kbd>https://<nowiki/>www.atpworldtour.com/en/players/andre-agassi/{{highlight|a092}}/overview</kbd>
}
: <kbd>https://<nowiki/>www.atpworldtour.com/en/players/-/{{highlight|a092}}/overview</kbd>
</templatedata>
: <kbd>https://<nowiki/>www.atpworldtour.com/Tennis/Players/{{highlight|A092}}.aspx</kbd>
: <kbd>https://<nowiki/>www.atpworldtour.com/Tennis/Players/{{highlight|A092}}</kbd>
: <kbd>https://<nowiki/>www.atpworldtour.com/Tennis/Players/{{highlight|Ag/A/Andre-Agassi|pink}}.aspx</kbd> ([https://web.archive.org/web/20090621195929/https://www.atpworldtour.com/Tennis/Players/Ag/A/Andre-Agassi.aspx archive])
: <kbd>https://<nowiki/>www.atpworldtour.com/Tennis/Players/{{highlight|Ag/A/Andre-Agassi|pink}}</kbd>

=== ID in Wikidata ===
; Usage in the article [[Björn Borg]]
: {{tlcw|a=1|ATP}}
: {{tlcw|a=1|ATP | name{{=}} Björn Borg }}

; Output
:* {{ATP | b058 | Björn Borg }} [[File:OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt=Edit this at Wikidata |link=https://www.wikidata.org/wiki/Q104506#P536 |Edit this at Wikidata]]

; Current URLs
: <kbd>[https://www.atptour.com/en/players/bjorn-borg/b058/overview https://www.atptour.com/en/players/bjorn-borg/{{highlight|b058}}/overview]</kbd>
: <kbd>[https://www.atptour.com/en/players/-/b058/overview https://www.atptour.com/en/players/-/{{highlight|b058}}/overview]</kbd>

; Former URLs
: <kbd>https://<nowiki/>www.atpworldtour.com/en/players/bjorn-borg/{{highlight|b058}}/overview</kbd>
: <kbd>https://<nowiki/>www.atpworldtour.com/en/players/-/{{highlight|b058}}/overview</kbd>
: <kbd>https://<nowiki/>www.atpworldtour.com/Tennis/Players/{{highlight|B058}}.aspx</kbd>
: <kbd>https://<nowiki/>www.atpworldtour.com/Tennis/Players/{{highlight|B058}}</kbd>
: <kbd>https://<nowiki/>www.atpworldtour.com/Tennis/Players/{{highlight|Bj/B/Bjorn-Borg|pink}}.aspx</kbd>
: <kbd>https://<nowiki/>www.atpworldtour.com/Tennis/Players/{{highlight|Bj/B/Bjorn-Borg|pink}}</kbd>

=== No ID in template or Wikidata ===
; Usage
: {{tlcw|a=1|ATP }}

; Output
:* {{ATP }}


== Instructions ==
== Instructions ==
Line 53: Line 88:
The name parameter is optional. It defaults to the page name, so it is necessary to provide it only when the player's name differs from the article name.
The name parameter is optional. It defaults to the page name, so it is necessary to provide it only when the player's name differs from the article name.


== Examples ==
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "This template displays an external link to a tennis player's profile at ATPtour.com (formerly ATPworldtour.com), the official website of the Association of Tennis Professionals (ATP). It is intended for use in the external links section of an article.",
"params": {
"id": {
"label": "id",
"aliases": ["1"],
"description": "The ID portion of the URL, which is not case-sensitive. It starts with the first letter of the player's surname and ends with three characters which may be letters or numbers. Examples: a092 or A092 for https://www.atptour.com/en/players/andre-agassi/a092/overview, mc10 or MC10 for https://www.atptour.com/en/players/andy-murray/mc10/overview, and p0dt or P0DT for https://www.atptour.com/en/players/frithjof-prydz/p0dt/overview.",
"type": "string",
"required": false,
"default": "Wikidata property P536"
},
"name": {
"label": "name",
"aliases": ["2"],
"description": "The link text, which should be the name of the tennis player. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as \"(tennis)\".",
"type": "string",
"required": false,
"default": "{{PAGENAMEBASE}}"
}
},
"paramOrder": [
"id",
"name"
]
}
</templatedata>


=== One parameter ===
== Tracking categories ==
* {{clc|ATP template with ID different from Wikidata}} – ''comparison is [[case insensitive]], so [https://www.atptour.com/en/players/-/a092/overview a092] matches [https://www.atptour.com/en/players/-/A092/overview A092]''
The following examples show a link to the page for [[Andre Agassi]]:
* {{clc|ATP template with ID not in Wikidata}}
: <code><nowiki>http://</nowiki>www.atpworldtour.com/Tennis/Players/{{hilite|A092}}.aspx</code>
* {{clc|ATP template missing ID and not in Wikidata}}
Usage:
: <code>{{((}}{{BASEPAGENAME}} {{!}} A092 {{))}}</code>
: <code>{{((}}{{BASEPAGENAME}} {{!}} id= A092 {{))}}</code>
Results:
: {{{{BASEPAGENAME}} | A092 }}
: {{{{BASEPAGENAME}} | id= A092 }}


=== Two parameters ===
== Templates and modules used ==
* [[Template:First word]], implemented with [[Module:String]]
The following examples show a link to the page for [[Björn Borg]]:
* [[Module:EditAtWikidata]]
: <code><nowiki>http://</nowiki>www.atpworldtour.com/Tennis/Players/{{hilite|B058}}.aspx</code>
* [[Module:WikidataCheck]]
Usage:
: <code>{{((}}{{BASEPAGENAME}} {{!}} B058 {{!}} Björn Borg {{))}}</code>
: <code>{{((}}{{BASEPAGENAME}} {{!}} id= B058 {{!}} name= Björn Borg {{))}}</code>
Results:
: {{{{BASEPAGENAME}} | B058 | Björn Borg }}
: {{{{BASEPAGENAME}} | id= B058 | name= Björn Borg }}


== See also ==
== See also ==
* {{tl|WTA}} – external link to player page at the [[Women's Tennis Association]]
* {{tl|WTA}}
* {{tl|ITF profile}}
* {{tl|ITF profile}} – external link to player page at the [[International Tennis Federation]]
* {{tl|Davis Cup player}} – external link to player page at the [[Davis Cup]] (men)
* {{tl|DavisCup player}}
* {{tl|Billie Jean King Cup player}} – external link to player page at the [[Billie Jean King Cup]] (women)

== External links ==
* [https://www.atptour.com/en/players ATP player search page]


<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:People and person external link templates|Atp]]
[[Category:People and person external link templates|Atp]]
[[Category:Tennis external link templates|Atp]]
[[Category:Tennis external link templates|Atp]]
[[Category:External link templates using Wikidata]]
[[Category:Templates that add a tracking category]]
}}</includeonly>
}}</includeonly>

Revision as of 08:52, 5 August 2024

Template:Association of Tennis Professionals link displays an external link to a tennis player's profile at ATPtour.com (formerly ATPworldtour.com), the official website of the Association of Tennis Professionals (ATP). It is intended for use in the external links section of an article.

Usage

Unnamed parameters
{{ATP | ID }}
{{ATP | ID | NAME }}
Named parameters
{{ATP | id= ID }}
{{ATP | id= ID | name= NAME }}
Using Wikidata property P536
{{ATP}}
{{ATP | name= NAME }}

Examples

ID in template

Usage in the article Andre Agassi, with article name as link text
* {{ATP | a092 }}
* {{ATP | id= a092 }}
Usage with name parameter as link text
* {{ATP | a092 | Andre Agassi }}
* {{ATP | id= a092 | name= Andre Agassi }}
Output
Current URLs
https://www.atptour.com/en/players/andre-agassi/a092/overview
https://www.atptour.com/en/players/-/a092/overview
Former URLs
https://www.atpworldtour.com/en/players/andre-agassi/a092/overview
https://www.atpworldtour.com/en/players/-/a092/overview
https://www.atpworldtour.com/Tennis/Players/A092.aspx
https://www.atpworldtour.com/Tennis/Players/A092
https://www.atpworldtour.com/Tennis/Players/Ag/A/Andre-Agassi.aspx (archive)
https://www.atpworldtour.com/Tennis/Players/Ag/A/Andre-Agassi

ID in Wikidata

Usage in the article Björn Borg
* {{ATP}}
* {{ATP | name= Björn Borg }}
Output
Current URLs
https://www.atptour.com/en/players/bjorn-borg/b058/overview
https://www.atptour.com/en/players/-/b058/overview
Former URLs
https://www.atpworldtour.com/en/players/bjorn-borg/b058/overview
https://www.atpworldtour.com/en/players/-/b058/overview
https://www.atpworldtour.com/Tennis/Players/B058.aspx
https://www.atpworldtour.com/Tennis/Players/B058
https://www.atpworldtour.com/Tennis/Players/Bj/B/Bjorn-Borg.aspx
https://www.atpworldtour.com/Tennis/Players/Bj/B/Bjorn-Borg

No ID in template or Wikidata

Usage
* {{ATP}}
Output
  • {{ATP}} template missing ID and not present in Wikidata.

Instructions

To find the id number:

  1. Go to the player's ATP profile page
  2. In the "Head to head" edit box on the right enter any player and submit
  3. You'll see their head to head record, and pId in the URL is the ID in question

* copied from GregorB's comment at WikiProject Tennis

Another way to find the id number:

  1. Go to the player's ATP profile page.
  2. View the HTML source of the page (found via the pop-up menu when right-clicking somewhere on the page).
  3. Search for the text "initPlayerLiveScoreParams", and use the code following that string.

The name parameter is optional. It defaults to the page name, so it is necessary to provide it only when the player's name differs from the article name.

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Association of Tennis Professionals link in articles based on its TemplateData.

TemplateData for Association of Tennis Professionals link

This template displays an external link to a tennis player's profile at ATPtour.com (formerly ATPworldtour.com), the official website of the Association of Tennis Professionals (ATP). It is intended for use in the external links section of an article.

Template parameters

ParameterDescriptionTypeStatus
idid 1

The ID portion of the URL, which is not case-sensitive. It starts with the first letter of the player's surname and ends with three characters which may be letters or numbers. Examples: a092 or A092 for https://www.atptour.com/en/players/andre-agassi/a092/overview, mc10 or MC10 for https://www.atptour.com/en/players/andy-murray/mc10/overview, and p0dt or P0DT for https://www.atptour.com/en/players/frithjof-prydz/p0dt/overview.

Default
Wikidata property P536
Stringoptional
namename 2

The link text, which should be the name of the tennis player. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as "(tennis)".

Default
{{PAGENAMEBASE}}
Stringoptional

Tracking categories

Templates and modules used

See also