Difference between revisions of "Template:HockeyDB/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
(update categories)
imported>Zyxw
(update documentation, add TemplateData)
Line 1: Line 1:
{{documentation subpage}}
+
{{Documentation subpage}}
 +
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
  
==Usage==
+
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to [[ice hockey]] player's or team's statistics at [http://www.hockeydb.com HockeyDB.com].
<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>
+
=== Player ===
produces:
+
Unnamed parameters:
{{Hockeydb|73288|Sidney Crosby}}
+
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|''ID''<nowiki>}}</nowiki></code>
 +
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|''ID''|''NAME''<nowiki>}}</nowiki></code>
  
'''Team example:'''
+
Named parameters:
<nowiki>{{</nowiki>Hockeydb|690|Colorado Avalanche|team=yes<nowiki>}}</nowiki>
+
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|id=''ID''<nowiki>}}</nowiki></code>
produces:
+
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|id=''ID''|name=''NAME''<nowiki>}}</nowiki></code>
{{Hockeydb|690|Colorado Avalanche|team=yes}}
 
  
<includeonly>
+
=== Team ===
[[Category:People and person external link templates|Hockeydb.com]]
+
Unnamed parameters:
[[Category:Ice hockey external link templates‎|Hockeydb.com]]
+
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|''ID''|team=yes<nowiki>}}</nowiki></code>
[[Category:WikiProject Ice Hockey templates|Hockeydb.com]]
+
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|''ID''|''NAME''|team=yes<nowiki>}}</nowiki></code>
  
[[fr:Modèle:Hockeydb]]
+
Named parameters:
[[ja:Template:Hockeydb]]
+
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|id=''ID''|team=yes<nowiki>}}</nowiki></code>
[[no:Mal:Hockeydb]]
+
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|id=''ID''|name=''NAME''|team=yes<nowiki>}}</nowiki></code>
</includeonly>
+
 
 +
== TemplateData ==
 +
{{TemplateDataHeader}}
 +
<templatedata>{
 +
"description": "This template displays an external link to an ice hockey player's or team's statistics at HockeyDB.com.",
 +
"params": {
 +
  "1": {
 +
    "label": "ID",
 +
    "aliases": ["id"],
 +
    "description": "Player's or team's ID number in the URL. Player: 73288 is the ID in http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288. Team: 690 is the ID in http://www.hockeydb.com/ihdb/stats/teamseasons.php?tid=690.",
 +
    "type": "number",
 +
    "default": "",
 +
    "required": true
 +
  },
 +
  "2": {
 +
    "label": "Name",
 +
    "aliases": ["name","title"],
 +
    "description": "Name of player or team. If not given it defaults to the Wikipedia article name, without any disambiguation such as (ice hockey).",
 +
    "type": "string",
 +
    "default": "{{PAGENAME}}",
 +
    "required": false
 +
  },
 +
  "team": {
 +
    "label": "Team",
 +
    "description": "If team=yes, the template will display team statistics instead of individual player statistics.",
 +
    "type": "string",
 +
    "default": "",
 +
    "required": false
 +
  }
 +
}}</templatedata>
 +
 
 +
== Examples ==
 +
 
 +
=== Player ===
 +
''Usage:'' <code><nowiki>{{</nowiki>Hockeydb | 73288 | Sidney Crosby }}</code>
 +
* ''Output:'' {{Hockeydb | 73288 | Sidney Crosby }}
 +
* ''URL:'' http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288
 +
 
 +
''Usage:'' <code><nowiki>{{</nowiki>Hockeydb |id= 73288 |name= Sidney Crosby }}</code>
 +
* ''Output:'' {{Hockeydb |id= 73288 |name= Sidney Crosby }}
 +
* ''URL:'' http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288
 +
 
 +
''Usage:'' <code><nowiki>{{</nowiki>Hockeydb |id= 73288 |title= Sidney Crosby }}</code>
 +
* ''Output:'' {{Hockeydb |id= 73288 |title= Sidney Crosby }}
 +
* ''URL:'' http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288
 +
 
 +
=== Team ===
 +
''Usage:'' <code><nowiki>{{</nowiki>Hockeydb | 690 | Colorado Avalanche |team= yes }}</code>
 +
* ''Output:'' {{Hockeydb | 690 | Colorado Avalanche |team= yes }}
 +
* ''URL:'' http://www.hockeydb.com/ihdb/stats/teamseasons.php?tid=690
 +
 
 +
''Usage:'' <code><nowiki>{{</nowiki>Hockeydb |id= 690 |name= Colorado Avalanche |team= yes }}</code>
 +
* ''Output:'' {{Hockeydb |id= 690 |name= Colorado Avalanche |team= yes }}
 +
* ''URL:'' http://www.hockeydb.com/ihdb/stats/teamseasons.php?tid=690
 +
 
 +
''Usage:'' <code><nowiki>{{</nowiki>Hockeydb |id= 690 |title= Colorado Avalanche |team= yes }}</code>
 +
* ''Output:'' {{Hockeydb |id= 690 |title= Colorado Avalanche |team= yes }}
 +
* ''URL:'' http://www.hockeydb.com/ihdb/stats/teamseasons.php?tid=690
 +
 
 +
== See also ==
 +
Ice hockey player external link templates:
 +
* 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>{{#ifeq:{{SUBPAGENAME}}|sandbox||
 +
<!-- Categories go here and interwikis go in Wikidata. -->
 +
[[Category:Ice hockey external link templates]]
 +
[[Category:WikiProject Ice Hockey templates]]
 +
[[Category:People and person external link templates]]
 +
}}</includeonly>

Revision as of 14:24, 3 May 2014

Template:HockeyDB displays an external link to ice hockey player's or team's statistics at HockeyDB.com.

Usage

Player

Unnamed parameters:

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

Named parameters:

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

Team

Unnamed parameters:

  • {{HockeyDB|ID|team=yes}}
  • {{HockeyDB|ID|NAME|team=yes}}

Named parameters:

  • {{HockeyDB|id=ID|team=yes}}
  • {{HockeyDB|id=ID|name=NAME|team=yes}}

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 an ice hockey player's or team's statistics at HockeyDB.com.

Template parameters

ParameterDescriptionTypeStatus
ID1 id

Player's or team's ID number in the URL. Player: 73288 is the ID in http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288. Team: 690 is the ID in http://www.hockeydb.com/ihdb/stats/teamseasons.php?tid=690.

Default
Numberrequired
Name2 name title

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

Default
{{PAGENAME}}
Stringoptional
Teamteam

If team=yes, the template will display team statistics instead of individual player statistics.

Default
Stringoptional

Examples

Player

Usage: {{Hockeydb | 73288 | Sidney Crosby }}

Usage: {{Hockeydb |id= 73288 |name= Sidney Crosby }}

Usage: {{Hockeydb |id= 73288 |title= Sidney Crosby }}

Team

Usage: {{Hockeydb | 690 | Colorado Avalanche |team= yes }}

Usage: {{Hockeydb |id= 690 |name= Colorado Avalanche |team= yes }}

Usage: {{Hockeydb |id= 690 |title= Colorado Avalanche |team= yes }}

See also

Ice hockey player external link templates: