Difference between revisions of "Template:Davis Cup player/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
(copy of current template)
 
imported>Zyxw
(add fix for empty name parameter)
Line 1: Line 1:
 
{{#if: {{{1<includeonly>|</includeonly>}}} {{{id|}}} {{#property:P2641}}
 
{{#if: {{{1<includeonly>|</includeonly>}}} {{{id|}}} {{#property:P2641}}
  
|[https://www.daviscup.com/en/players/player.aspx?id={{#if: {{{1|{{{id<includeonly>|</includeonly>}}}}}} | {{{1|{{{id}}}}}} | {{First word|{{#property:P2641}}|sep=,}} }} {{{2|{{{name<includeonly>|{{PAGENAMEBASE}}</includeonly>}}}}}}] at the [[Davis Cup]]<includeonly>{{EditAtWikidata|pid=P2641|{{{1|{{{id|}}}}}}}}</includeonly>
+
| [https://www.daviscup.com/en/players/player.aspx?id={{#if: {{{1|{{{id<includeonly>|</includeonly>}}}}}}
 +
  | {{{1|{{{id}}}}}}
 +
  | {{First word|{{#property:P2641}}|sep=,}}
 +
  }} {{#if: {{{2|{{{name<includeonly>|</includeonly>}}}}}}
 +
  | {{{2|{{{name}}}}}}
 +
  | {{PAGENAMEBASE}}
 +
  }}] at the [[Davis Cup]]<includeonly>{{EditAtWikidata|pid=P2641|{{{1|{{{id|}}}}}}}}</includeonly>
  
|<span class="error">&#123;&#123;[[Template:Davis Cup player|Davis Cup player]]&#125;&#125; template missing ID and not present in Wikidata.</span>
+
| <span class="error">&#123;&#123;[[Template:Davis Cup player|Davis Cup player]]&#125;&#125; template missing ID and not present in Wikidata.</span>
  
 
}}<noinclude>
 
}}<noinclude>
 
{{Documentation}}<!-- Please add categories to the /doc subpage & add interwikis to Wikidata. -->
 
{{Documentation}}<!-- Please add categories to the /doc subpage & add interwikis to Wikidata. -->
 
</noinclude>
 
</noinclude>

Revision as of 05:03, 19 July 2018

{{{name}}} at the Davis Cup

50px Template documentation[view] [edit] [history] [purge]

Template:Uses Wikidata Template:Tracks Wikidata

Template:Davis Cup player displays an external link to a tennis player's profile at DavisCup.com, the official website of the Davis Cup. It is intended for use in the external links section of an article.

Usage

Unnamed parameters:

Template:Tlcw
Template:Tlcw

Named parameters:

Template:Tlcw
Template:Tlcw

Using Wikidata property P2641:

Template:Tlcw
Template:Tlcw

Examples

ID in template

Usage in the article James Blake, with article name as link text:

Template:Tlcw
Template:Tlcw

Usage with name parameter as link text:

Template:Tlcw
Template:Tlcw

Output:

URLs:

https://www.daviscup.com/en/players/player.aspx?id=800198270
http://www.daviscup.com/en/players/player/profile.aspx?playerid=10021072 (former ID, archived 2016-03-14)

ID in Wikidata

Usage in the article Rod Laver:

Template:Tlcw
Template:Tlcw

Output:

URLs:

https://www.daviscup.com/en/players/player.aspx?id=800173355
http://www.daviscup.com/en/players/player/profile.aspx?playerid=10002749 (former ID, archived 2016-03-14)

No ID in template or Wikidata

Usage:

Template:Tlcw

Output:

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Davis Cup player

This template displays an external link to a tennis player's profile at DavisCup.com, the official website of the Davis Cup. It is intended for use in the external links section of an article.

Template parameters

ParameterDescriptionTypeStatus
idid 1

The "id" parameter (or unnamed parameter "1") should contain the ID portion of the URL. Example: 800198270 is the ID in https://www.daviscup.com/en/players/player.aspx?id=800198270.

Default
Wikidata property P2641
Numberoptional
namename 2

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)".

Default
{{PAGENAMEBASE}}
Stringoptional

Tracking categories

template with ID
template missing ID

Templates and modules used

See also