Difference between revisions of "Template:HockeyDB/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
(update documentation, add TemplateData)
imported>Vanisaac
m (→‎See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
 
(9 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. -->
 
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
 +
{{Uses Wikidata|P2602}}
 +
{{Lua|Module:EditAtWikidata}}
  
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to [[ice hockey]] player's or team's statistics at [http://www.hockeydb.com HockeyDB.com].
+
'''{{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.
  
 
== Usage ==
 
== Usage ==
=== Player ===
+
 
 
Unnamed parameters:
 
Unnamed parameters:
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|''ID''<nowiki>}}</nowiki></code>
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|''ID''|''NAME''<nowiki>}}</nowiki></code>
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''NAME'' }}</code>
  
 
Named parameters:
 
Named parameters:
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|id=''ID''<nowiki>}}</nowiki></code>
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' }}</code>
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|id=''ID''|name=''NAME''<nowiki>}}</nowiki></code>
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
  
=== Team ===
+
Using [[Wikidata]] property {{Property|2602}}:
Unnamed parameters:
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|''ID''|team=yes<nowiki>}}</nowiki></code>
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|''ID''|''NAME''|team=yes<nowiki>}}</nowiki></code>
+
 
 +
== Examples ==
  
Named parameters:
+
=== Unnamed parameters ===
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|id=''ID''|team=yes<nowiki>}}</nowiki></code>
+
''URL:''
* <code><nowiki>{{</nowiki>{{BASEPAGENAME}}|id=''ID''|name=''NAME''|team=yes<nowiki>}}</nowiki></code>
+
: <kbd>[http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288 http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid={{hilite|73288}}]</kbd>
  
== TemplateData ==
+
''Usage:''
{{TemplateDataHeader}}
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 73288 | Sidney Crosby }}</code>
<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 ==
+
''Output:''
 +
:* {{{{BASEPAGENAME}} | 73288 | Sidney Crosby }}
  
=== Player ===
+
=== Named parameters ===
''Usage:'' <code><nowiki>{{</nowiki>Hockeydb | 73288 | Sidney Crosby }}</code>
+
''URL:''
* ''Output:'' {{Hockeydb | 73288 | Sidney Crosby }}
+
: <kbd>[http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=203186 http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid={{hilite|203186}}]</kbd>
* ''URL:'' http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288
 
  
''Usage:'' <code><nowiki>{{</nowiki>Hockeydb |id= 73288 |name= Sidney Crosby }}</code>
+
''Usage:''
* ''Output:'' {{Hockeydb |id= 73288 |name= Sidney Crosby }}
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= 203186 | name= Amanda Leveille }}</code>
* ''URL:'' http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288
 
  
''Usage:'' <code><nowiki>{{</nowiki>Hockeydb |id= 73288 |title= Sidney Crosby }}</code>
+
''Output:''
* ''Output:'' {{Hockeydb |id= 73288 |title= Sidney Crosby }}
+
:* {{{{BASEPAGENAME}} | id= 203186 | name= Amanda Leveille }}
* ''URL:'' http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288
 
  
=== Team ===
+
=== No parameters and Wikidata property not defined ===
''Usage:'' <code><nowiki>{{</nowiki>Hockeydb | 690 | Colorado Avalanche |team= yes }}</code>
+
''Usage:''
* ''Output:'' {{Hockeydb | 690 | Colorado Avalanche |team= yes }}
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
* ''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:''
* ''Output:'' {{Hockeydb |id= 690 |name= Colorado Avalanche |team= yes }}
+
:* {{ {{BASEPAGENAME}} }}
* ''URL:'' http://www.hockeydb.com/ihdb/stats/teamseasons.php?tid=690
 
  
''Usage:'' <code><nowiki>{{</nowiki>Hockeydb |id= 690 |title= Colorado Avalanche |team= yes }}</code>
+
== TemplateData ==
* ''Output:'' {{Hockeydb |id= 690 |title= Colorado Avalanche |team= yes }}
+
{{TemplateData header}}
* ''URL:'' http://www.hockeydb.com/ihdb/stats/teamseasons.php?tid=690
+
<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 ==
 
== See also ==
 
Ice hockey player external link templates:
 
Ice hockey player external link templates:
 +
* {{tl|Ice hockey stats}}
 
* Official league websites:
 
* Official league websites:
 
** {{tl|AHL profile}}
 
** {{tl|AHL profile}}
Line 96: Line 95:
 
** {{tl|Legendsofhockey}}
 
** {{tl|Legendsofhockey}}
 
** {{tl|TSN-NHL profile}}
 
** {{tl|TSN-NHL profile}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
+
 
 +
<includeonly>{{Sandbox other||
 
<!-- Categories go here and interwikis go in Wikidata. -->
 
<!-- Categories go here and interwikis go in Wikidata. -->
 
[[Category:Ice hockey external link templates]]
 
[[Category:Ice hockey external link templates]]
[[Category:WikiProject Ice Hockey templates]]
 
 
[[Category:People and person external link templates]]
 
[[Category:People and person external link templates]]
 +
[[Category:External link templates using Wikidata]]
 
}}</includeonly>
 
}}</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: