Template:ATP/doc

It is intended for use in the external links section of an article.

Usage
Unnamed parameters:

Named parameters:

Using Wikidata property P536:

ID in template
Usage in the article Andre Agassi, with article name as link text:

Usage with name parameter as link text:

Output:

URLs:
 * https://www.atpworldtour.com/Tennis/Players/.aspx
 * https://www.atpworldtour.com/en/players/andre-agassi//overview

ID in Wikidata
Usage in the article Björn Borg:

Output:
 * Blue pencil.svg

URLs:
 * https://www.atpworldtour.com/Tennis/Players/.aspx
 * https://www.atpworldtour.com/en/players/bjorn-borg//overview

No ID in template or Wikidata
Usage:

Output:

Instructions
To find the id number: * copied from GregorB's comment at WikiProject Tennis
 * 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

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
{ "description": "This template displays an external link to a tennis player's profile at 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\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL. Example: A092 is the ID number in https://www.atpworldtour.com/Tennis/Players/A092.aspx or https://www.atpworldtour.com/en/players/andre-agassi/a092/overview.", "type": "number", "required": false, "default": "Wikidata property P536" },   "name": { "label": "name", "aliases": ["2"], "description": "The \"name\" parameter (or unnamed parameter \"2\") may be used to specify 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": "" } },  "paramOrder": [ "id", "name" ] }

Templates and modules used

 * Template:First word, implemented with Module:String
 * Module:EditAtWikidata