Difference between revisions of "Template:Legendsofhockey/doc"

From blackwiki
Jump to navigation Jump to search
imported>GZWDer
imported>Djsasso
Line 13: Line 13:
 
produces:
 
produces:
 
{{Legendsofhockey|21614|Sidney Crosby}}
 
{{Legendsofhockey|21614|Sidney Crosby}}
 +
 +
== TemplateData ==
 +
{{TemplateData header}}
 +
<templatedata>
 +
{
 +
  "description": "This template displays an external link to an NHL ice hockey player's profile at the Hockey Hall of Fame website. It is intended for use in the external links section of an article.",
 +
  "params": {
 +
    "id": {
 +
      "label": "Player ID",
 +
      "aliases": ["1"],
 +
      "description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL for the player's profile. Example: 14279 is the ID portion of http://www.hhof.com/LegendsOfHockey/jsp/SearchPlayer.jsp?player=14279. This parameter is optional if Wikidata property P3567 exists, but required if not.",
 +
      "type": "number",
 +
      "required": false,
 +
      "default": "Wikidata property P3567"
 +
    },
 +
    "name": {
 +
      "label": "Player name",
 +
      "aliases": ["2"],
 +
      "description": "The \"name\" parameter (or unnamed parameter \"2\") may be used to specify the link text, which should be the name of the player. This parameter is optional; 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==
Line 20: Line 50:
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
[[Category:Ice hockey external link templates|Legendsofhockey.net]]
 
[[Category:Ice hockey external link templates|Legendsofhockey.net]]
 +
[[Category:External link templates using Wikidata]]
 +
[[Category:People and person external link templates]]
 
[[Category:WikiProject Ice Hockey templates|Legendsofhockey.net]]
 
[[Category:WikiProject Ice Hockey templates|Legendsofhockey.net]]
[[Category:People and person external link templates]]
 
  
 
[[ja:Template:Legendsofhockey]]
 
[[ja:Template:Legendsofhockey]]
 
[[no:Mal:Legendsofhockey]]
 
[[no:Mal:Legendsofhockey]]
 
</includeonly>
 
</includeonly>

Revision as of 11:50, 10 August 2017

Template:Wikidata property

Usage

{{Legendsofhockey|id|name}}

where:

  • id is the numeric id found in url
  • name is the player's name
    • optional parameter. Defaults to {{PAGENAME}} if omitted.

example:

{{Legendsofhockey|21614|Sidney Crosby}}

produces: Sidney Crosby biography at Legends of HockeyScript error: No such module "EditAtWikidata".

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 Legendsofhockey

This template displays an external link to an NHL ice hockey player's profile at the Hockey Hall of Fame website. It is intended for use in the external links section of an article.

Template parameters

ParameterDescriptionTypeStatus
Player IDid 1

The "id" parameter (or unnamed parameter "1") should contain the ID portion of the URL for the player's profile. Example: 14279 is the ID portion of http://www.hhof.com/LegendsOfHockey/jsp/SearchPlayer.jsp?player=14279. This parameter is optional if Wikidata property P3567 exists, but required if not.

Default
Wikidata property P3567
Numberoptional
Player namename 2

The "name" parameter (or unnamed parameter "2") may be used to specify the link text, which should be the name of the player. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as "(ice hockey)".

Default
{{PAGENAMEBASE}}
Stringoptional

See also

{{Legendsmember}} for NHL players inducted into the Hockey Hall of Fame