Difference between revisions of "Template:HockeyDB/doc"

From blackwiki
Jump to navigation Jump to search
imported>Djsasso
imported>Vanisaac
m (→‎See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
 
(6 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
{{Lua|Module:EditAtWikidata}}
 
{{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]. It is intended for use in the [[Wikipedia:External links|external links]] section of an article.
+
'''{{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'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
Line 17: Line 16:
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
  
Using [[Wikidata]] property [[d:Property:P2602|P2602]]:
+
Using [[Wikidata]] property {{Property|2602}}:
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
 
=== Team ===
 
Unnamed parameters:
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | team= yes | ''ID'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | team= yes | ''ID'' | ''NAME'' }}</code>
 
 
Named parameters:
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | team= yes | id= ''ID'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | team= yes | id= ''ID'' | name= ''NAME'' }}</code>
 
  
 
== Examples ==
 
== Examples ==
  
=== Player ===
+
=== Unnamed parameters ===
http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288
+
''URL:''
 
+
: <kbd>[http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288 http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid={{hilite|73288}}]</kbd>
; Unnamed parameters
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | 73288 | Sidney Crosby }}</code>
 
: {{{{BASEPAGENAME}} | 73288 | Sidney Crosby }}
 
 
 
; Named parameters (id, name)
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} |id= 73288 |name= Sidney Crosby }}</code>
 
: {{{{BASEPAGENAME}} |id= 73288 |name= Sidney Crosby }}
 
  
; Named parameters (id, title)
+
''Usage:''
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} |id= 73288 |title= Sidney Crosby }}</code>
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 73288 | Sidney Crosby }}</code>
: {{{{BASEPAGENAME}} |id= 73288 |title= Sidney Crosby }}
 
  
; Missing ID parameter and Wikidata property not defined
+
''Output:''
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
+
:* {{{{BASEPAGENAME}} | 73288 | Sidney Crosby }}
: {{{{BASEPAGENAME}}<!-- -->}}
 
  
=== Team ===
+
=== Named parameters ===
http://www.hockeydb.com/ihdb/stats/teamseasons.php?tid=690
+
''URL:''
 +
: <kbd>[http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=203186 http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid={{hilite|203186}}]</kbd>
  
; Unnamed parameters
+
''Usage:''
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | team= yes | 690 | Colorado Avalanche }}</code>
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= 203186 | name= Amanda Leveille }}</code>
: {{{{BASEPAGENAME}} | team= yes | 690 | Colorado Avalanche }}
 
  
; Named parameters (id, name)
+
''Output:''
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | team= yes |id= 690 |name= Colorado Avalanche }}</code>
+
:* {{{{BASEPAGENAME}} | id= 203186 | name= Amanda Leveille }}
: {{{{BASEPAGENAME}} | team= yes |id= 690 |name= Colorado Avalanche }}
 
  
; Named parameters (id, title)
+
=== No parameters and Wikidata property not defined ===
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | team= yes |id= 690 |title= Colorado Avalanche }}</code>
+
''Usage:''
: {{{{BASEPAGENAME}} | team= yes |id= 690 |title= Colorado Avalanche }}
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
  
; Missing ID parameter
+
''Output:''
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | team= yes }}</code>
+
:* {{ {{BASEPAGENAME}} }}
: {{{{BASEPAGENAME}} | team= yes }}
 
  
 
== TemplateData ==
 
== TemplateData ==
Line 74: Line 53:
 
<templatedata>
 
<templatedata>
 
{
 
{
   "description": "This template displays an external link to ice hockey player's or team's statistics at HockeyDB.com. It is intended for use in the external links section of an article.",
+
   "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": {
 
   "params": {
 
     "id": {
 
     "id": {
 
       "label": "id",
 
       "label": "id",
 
       "aliases": ["1"],
 
       "aliases": ["1"],
       "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. For players, this parameter is optional if Wikidata property 2602 exists, but required if not. For teams, this parameter is required.",
+
       "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",
 
       "type": "number",
 
       "required": false,
 
       "required": false,
       "default": "Wikidata property P2602 (for players)"
+
       "default": "Wikidata property P2602"
 
     },
 
     },
 
     "name": {
 
     "name": {
 
       "label": "name",
 
       "label": "name",
       "aliases": ["title", "2"],  
+
       "aliases": ["2"],  
       "description": "Name of player or team. If not given it defaults to the Wikipedia article name, without any disambiguation such as (ice hockey).",
+
       "description": "Name of player. If not given it defaults to the Wikipedia article name, without any disambiguation such as (ice hockey).",
 
       "type": "string",
 
       "type": "string",
 
       "required": false,
 
       "required": false,
 
       "default": "{{PAGENAMEBASE}}"
 
       "default": "{{PAGENAMEBASE}}"
    },
 
    "team": {
 
      "label": "team",
 
      "description": "If team=yes, the template will display team statistics instead of individual player statistics.",
 
      "type": "string",
 
      "required": false
 
 
     }
 
     }
 
   },
 
   },
 
   "paramOrder": [
 
   "paramOrder": [
 
     "id",
 
     "id",
     "name",
+
     "name"
    "team"
 
 
   ]
 
   ]
 
}
 
}
Line 109: Line 81:
 
== 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 122: 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]]

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: