Jump to content

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

From Wikipedia, the free encyclopedia
Content deleted Content added
update documentation and examples, add TemplateData
TemplateData: Updated PAGENAME to PAGENAMEBASE
Line 32: Line 32:
"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).",
"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).",
"type": "string",
"type": "string",
"default": "{{PAGENAME}}",
"default": "{{PAGENAMEBASE}}",
"required": false
"required": false
}
}

Revision as of 18:55, 9 August 2015

Template:Association of Tennis Professionals link displays an external link to a player's profile at the Association of Tennis Professionals (ATP) website.

Usage

One parameter:

{{Association of Tennis Professionals link | ID }}
{{Association of Tennis Professionals link | id= ID }}

Two parameters:

{{Association of Tennis Professionals link | ID | NAME }}
{{Association of Tennis Professionals link | id= ID | name= 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 player's profile at the Association of Tennis Professionals (ATP) website.

Template parameters

ParameterDescriptionTypeStatus
ID1 id

Identification string in the URL. Example: A092 is the ID number in http://www.atpworldtour.com/Tennis/Players/A092.aspx

Default
Stringrequired
Name2 name

Name to be displayed in the link text. If not given it defaults to the Wikipedia article name, without any disambiguation such as (tennis).

Default
{{PAGENAMEBASE}}
Stringoptional

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.

Examples

One parameter

The following examples show a link to the page for Andre Agassi:

http://www.atpworldtour.com/Tennis/Players/A092.aspx

Usage:

{{Association of Tennis Professionals link | A092 }}
{{Association of Tennis Professionals link | id= A092 }}

Results:

Association of Tennis Professionals link/doc at the Association of Tennis Professionals
Association of Tennis Professionals link/doc at the Association of Tennis Professionals

Two parameters

The following examples show a link to the page for Björn Borg:

http://www.atpworldtour.com/Tennis/Players/B058.aspx

Usage:

{{Association of Tennis Professionals link | B058 | Björn Borg }}
{{Association of Tennis Professionals link | id= B058 | name= Björn Borg }}

Results:

Björn Borg at the Association of Tennis Professionals
Björn Borg at the Association of Tennis Professionals

See also