Difference between revisions of "Template:HockeyDB/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
(add link to tracking categories, add template category)
imported>Zyxw
(update for removal of unused parameters)
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|P2602}}:
 
: <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 ===
Unnamed parameters:
+
''URL:''
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | team= yes | ''ID'' }}</code>
+
: <kbd>[http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288 http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid={{hilite|73288}}]</kbd>
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | team= yes | ''ID'' | ''NAME'' }}</code>
 
  
Named parameters:
+
''Usage:''
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | team= yes | id= ''ID'' }}</code>
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 73288 | Sidney Crosby }}</code>
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | team= yes | id= ''ID'' | name= ''NAME'' }}</code>
 
  
== Examples ==
+
''Output:''
 +
:* {{{{BASEPAGENAME}} | 73288 | Sidney Crosby }}
  
=== Player ===
+
=== Named parameters ===
http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=73288
+
''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
 
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 73288 | Sidney Crosby }}</code>
 
:* {{{{BASEPAGENAME}} | 73288 | Sidney Crosby }}
 
  
; Named parameters (id, name)
+
''Usage:''
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} |id= 73288 |name= Sidney Crosby }}</code>
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= 203186 | name= Amanda Leveille }}</code>
:* {{{{BASEPAGENAME}} |id= 73288 |name= Sidney Crosby }}
 
  
; Named parameters (id, title)
+
''Output:''
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} |id= 73288 |title= Sidney Crosby }}</code>
+
:* {{{{BASEPAGENAME}} | id= 203186 | name= Amanda Leveille }}
:* {{{{BASEPAGENAME}} |id= 73288 |title= Sidney Crosby }}
 
  
; Missing ID parameter and Wikidata property not defined
+
=== No parameters and Wikidata property not defined ===
 +
''Usage:''
 
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
:* {{{{BASEPAGENAME}}<!-- -->}}
 
 
=== Team ===
 
http://www.hockeydb.com/ihdb/stats/teamseasons.php?tid=690
 
 
; Unnamed parameters
 
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | team= yes | 690 | Colorado Avalanche }}</code>
 
:* {{{{BASEPAGENAME}} | team= yes | 690 | Colorado Avalanche }}
 
 
; Named parameters (id, name)
 
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | team= yes |id= 690 |name= Colorado Avalanche }}</code>
 
:* {{{{BASEPAGENAME}} | team= yes |id= 690 |name= Colorado Avalanche }}
 
  
; Named parameters (id, title)
+
''Output:''
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | team= yes |id= 690 |title= Colorado Avalanche }}</code>
+
:* {{ {{BASEPAGENAME}} }}
:* {{{{BASEPAGENAME}} | team= yes |id= 690 |title= Colorado Avalanche }}
 
 
 
; Missing ID parameter
 
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | team= yes }}</code>
 
:* {{{{BASEPAGENAME}} | team= yes }}
 
  
 
== TemplateData ==
 
== TemplateData ==
Line 74: Line 51:
 
<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"
 
 
   ]
 
   ]
 
}
 
}
 
</templatedata>
 
</templatedata>
 
== Tracking category ==
 
* {{clc|Pages using HockeyDB template with team parameter}}
 
* {{clc|Pages using HockeyDB template with title parameter}}
 
  
 
== See also ==
 
== See also ==
Line 133: Line 99:
 
[[Category:People and person external link templates]]
 
[[Category:People and person external link templates]]
 
[[Category:External link templates using Wikidata]]
 
[[Category:External link templates using Wikidata]]
[[Category:Templates that add a tracking category]]
 
 
}}</includeonly>
 
}}</includeonly>

Revision as of 02:23, 15 September 2018

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 }}

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: