Difference between revisions of "Template:HockeyDB/doc"

From blackwiki
Jump to navigation Jump to search
(+ja)
imported>Vanisaac
m (→‎See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{documentation subpage}}
+
{{Documentation subpage}}
 +
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
 +
{{Uses Wikidata|P2602}}
 +
{{Lua|Module:EditAtWikidata}}
  
==Usage==
+
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to [[ice hockey]] player's statistics at [http://www.hockeydb.com HockeyDB.com]. It is intended for use in the [[Wikipedia:External links|external links]] section of an article.
<nowiki>{{</nowiki>Hockeydb|''id''|''name''|[''team=yes'']<nowiki>}}</nowiki>
 
where:
 
*<code>''id''</code> is the numeric id found in url <code><nowiki>http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=XXXXX</nowiki></code> for players or <code><nowiki>http://www.hockeydb.com/ihdb/stats/teamseasons.php?tid=XXX</nowiki></code> for teams
 
*<code>''name''</code> is the player/team name
 
*<code>''team=yes''</code> is an ''optional field'' that will make the template work to display team statistics instead of individual
 
  
'''Example:'''
+
== Usage ==
<nowiki>{{</nowiki>Hockeydb|73288|Sidney Crosby<nowiki>}}</nowiki>
 
produces:
 
{{Hockeydb|73288|Sidney Crosby}}
 
  
'''Team example:'''
+
Unnamed parameters:
<nowiki>{{</nowiki>Hockeydb|690|Colorado Avalanche|team=yes<nowiki>}}</nowiki>
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
produces:
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''NAME'' }}</code>
{{Hockeydb|690|Colorado Avalanche|team=yes}}
 
  
<includeonly>
+
Named parameters:
[[Category:People and person external link templates|Hockeydb.com]]
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' }}</code>
[[Category:Sports external link templates|Hockeydb.com]]
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
[[Category:WikiProject Ice Hockey templates|Hockeydb.com]]
 
  
[[fr:Modèle:Hockeydb]]
+
Using [[Wikidata]] property {{Property|2602}}:
[[ja:Template:Hockeydb]]
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
[[no:Mal:Hockeydb]]
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
</includeonly>
+
 
 +
== Examples ==
 +
 
 +
=== Unnamed parameters ===
 +
''URL:''
 +
: <kbd>[http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288 http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid={{hilite|73288}}]</kbd>
 +
 
 +
''Usage:''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 73288 | Sidney Crosby }}</code>
 +
 
 +
''Output:''
 +
:* {{{{BASEPAGENAME}} | 73288 | Sidney Crosby }}
 +
 
 +
=== Named parameters ===
 +
''URL:''
 +
: <kbd>[http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=203186 http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid={{hilite|203186}}]</kbd>
 +
 
 +
''Usage:''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= 203186 | name= Amanda Leveille }}</code>
 +
 
 +
''Output:''
 +
:* {{{{BASEPAGENAME}} | id= 203186 | name= Amanda Leveille }}
 +
 
 +
=== No parameters and Wikidata property not defined ===
 +
''Usage:''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
 
 +
''Output:''
 +
:* {{ {{BASEPAGENAME}} }}
 +
 
 +
== TemplateData ==
 +
{{TemplateData header}}
 +
<templatedata>
 +
{
 +
  "description": "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.",
 +
  "params": {
 +
    "id": {
 +
      "label": "id",
 +
      "aliases": ["1"],
 +
      "description": "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.",
 +
      "type": "number",
 +
      "required": false,
 +
      "default": "Wikidata property P2602"
 +
    },
 +
    "name": {
 +
      "label": "name",
 +
      "aliases": ["2"],
 +
      "description": "Name of player. If not given it defaults to the Wikipedia article name, without any disambiguation such as (ice hockey).",
 +
      "type": "string",
 +
      "required": false,
 +
      "default": "{{PAGENAMEBASE}}"
 +
    }
 +
  },
 +
  "paramOrder": [
 +
    "id",
 +
    "name"
 +
  ]
 +
}
 +
</templatedata>
 +
 
 +
== See also ==
 +
Ice hockey player external link templates:
 +
* {{tl|Ice hockey stats}}
 +
* Official league websites:
 +
** {{tl|AHL profile}}
 +
** {{tl|ECHL profile}}
 +
** {{tl|EIHL profile}}
 +
** {{tl|NHL profile}}
 +
** {{tl|KHL profile}}
 +
* Other websites:
 +
** {{tl|Eliteprospects}}
 +
** {{tl|Eurohockey}}
 +
** {{tl|Hockey-reference}}
 +
** {{tl|Legendsmember}}
 +
** {{tl|Legendsofhockey}}
 +
** {{tl|TSN-NHL profile}}
 +
 
 +
<includeonly>{{Sandbox other||
 +
<!-- Categories go here and interwikis go in Wikidata. -->
 +
[[Category:Ice hockey external link templates]]
 +
[[Category:People and person external link templates]]
 +
[[Category:External link templates using Wikidata]]
 +
}}</includeonly>

Latest revision as of 16:56, 25 April 2020

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: