Difference between revisions of "Template:HockeyDB/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
(copy of current template)
 
imported>Zyxw
(Update handlng of missing ID. For players, use Wikidata property P2602 if no ID specified.)
 
Line 1: Line 1:
{{#ifeq: {{{team}}} | yes | [http://www.hockeydb.com/ihdb/stats/teamseasons.php?tid={{Trim|{{{1|{{{id}}}}}}}} {{Trim|{{{2|{{{title|{{{name<includeonly>|{{PAGENAMEBASE}}</includeonly>}}}}}}}}}}} season statistics and records] | [http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid={{Trim|{{{1|{{{id}}}}}}}} {{Trim|{{{2|{{{title|{{{name<includeonly>|{{PAGENAMEBASE}}</includeonly>}}}}}}}}}}}'s career statistics]}} at [http://www.hockeydb.com/ The Internet Hockey Database]<noinclude>
+
{{#ifeq: {{{team}}} | yes
{{documentation}}
+
|{{#if: {{{1<includeonly>|</includeonly>}}} {{{id|}}}
 +
|[http://www.hockeydb.com/ihdb/stats/teamseasons.php?tid={{Trim|{{{1|{{{id}}}}}}}} {{Trim|{{{2|{{{title|{{{name<includeonly>|{{PAGENAMEBASE}}</includeonly>}}}}}}}}}}} season statistics and records] at [http://www.hockeydb.com/ The Internet Hockey Database]
 +
|<span class="error">&#123;&#123;[[Template:HockeyDB|HockeyDB]]&#125;&#125; template missing team ID.</span>
 +
}}
 +
|{{#if: {{{1<includeonly>|</includeonly>}}} {{{id|}}} {{#property:P2602}}
 +
|[http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid={{Trim|{{{1|{{{id<includeonly>|{{#property:P2602}}</includeonly>}}}}}}}} {{Trim|{{{2|{{{title|{{{name<includeonly>|{{PAGENAMEBASE}}</includeonly>}}}}}}}}}}}'s career statistics] at [http://www.hockeydb.com/ The Internet Hockey Database]<includeonly>{{EditAtWikidata|pid=P2602|{{{1|{{{id|}}}}}}}}</includeonly>
 +
|<span class="error">&#123;&#123;[[Template:HockeyDB|HockeyDB]]&#125;&#125; template missing player ID and not present in Wikidata.</span>
 +
}}
 +
}}<noinclude>
 +
{{Documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 09:24, 25 April 2017

{{{name}}}'s career statistics at The Internet Hockey Database

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

Template:Uses Wikidata

Template:HockeyDB displays an external link to ice hockey player's statistics at HockeyDB.com. It is intended for use in the external links section of an article.

Usage

Unnamed parameters:

{{HockeyDB | ID }}
{{HockeyDB | ID | NAME }}

Named parameters:

{{HockeyDB | id= ID }}
{{HockeyDB | id= ID | name= NAME }}

Using Wikidata property Template:Property:

{{HockeyDB}}
{{HockeyDB | name= NAME }}

Examples

Unnamed parameters

URL:

http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288

Usage:

* {{HockeyDB | 73288 | Sidney Crosby }}

Output:

Named parameters

URL:

http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=203186

Usage:

* {{HockeyDB | id= 203186 | name= Amanda Leveille }}

Output:

No parameters and Wikidata property not defined

Usage:

* {{HockeyDB}}

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 HockeyDB

This template displays an external link to ice hockey player's statistics at HockeyDB.com. It is intended for use in the external links section of an article.

Template parameters

ParameterDescriptionTypeStatus
idid 1

Player's ID number in the URL. Example: 73288 is the ID in http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288. This parameter is optional if Wikidata property P2602 exists, but required if not.

Default
Wikidata property P2602
Numberoptional
namename 2

Name of player. If not given it defaults to the Wikipedia article name, without any disambiguation such as (ice hockey).

Default
{{PAGENAMEBASE}}
Stringoptional

See also

Ice hockey player external link templates: