Difference between revisions of "Template:Legendsofhockey/doc"

From blackwiki
Jump to navigation Jump to search
imported>Djsasso
imported>Zyxw
(update usage and examples)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 +
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
 +
{{Uses Wikidata|P3567}}
 
{{Lua|Module:EditAtWikidata}}
 
{{Lua|Module:EditAtWikidata}}
 
{{For|Hockey Hall of Fame members (inductees)|Template:Legendsmember}}
 
{{For|Hockey Hall of Fame members (inductees)|Template:Legendsmember}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
{{Wikidata property|P3567}}
 
==Usage==
 
<nowiki>{{</nowiki>Legendsofhockey|''id''|''name''<nowiki>}}</nowiki>
 
where:
 
*<code>''id''</code> is the numeric id found in url
 
*<code>''name''</code> is the player's name
 
**optional parameter. Defaults to <code><nowiki>{{PAGENAME}}</nowiki></code> if omitted.
 
  
example:
+
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to an [[National Hockey League|NHL]] ice hockey player's profile at the [[Hockey Hall of Fame]] website. It is intended for use in the [[Wikipedia:External links|external links]] section of an article.
<nowiki>{{</nowiki>Legendsofhockey|21614|Sidney Crosby<nowiki>}}</nowiki>
+
 
produces:
+
== Usage ==
{{Legendsofhockey|21614|Sidney Crosby}}
+
 
 +
Unnamed parameters:
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''NAME'' }}</code>
 +
 
 +
Named parameters:
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
 +
 
 +
Using [[Wikidata]] property {{Property|3567}}:
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
 +
 
 +
== Examples ==
 +
 
 +
=== Unnamed parameters ===
 +
''URL:''
 +
: <kbd>[http://www.legendsofhockey.net/LegendsOfHockey/jsp/SearchPlayer.jsp?player=14279 http://www.legendsofhockey.net/LegendsOfHockey/jsp/SearchPlayer.jsp?player={{hilite|14279}}]</kbd>
 +
 
 +
''Usage:''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 14279 | Eddie Shack }}</code>
 +
 
 +
''Output:''
 +
:* {{{{BASEPAGENAME}} | 14279 | Eddie Shack }}
 +
 
 +
=== Named parameters ===
 +
''URL:''
 +
: <kbd>[http://www.legendsofhockey.net/LegendsOfHockey/jsp/SearchPlayer.jsp?player=21614 http://www.legendsofhockey.net/LegendsOfHockey/jsp/SearchPlayer.jsp?player={{hilite|21614}}]</kbd>
 +
 
 +
''Usage:''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= 21614 | name= Sidney Crosby }}</code>
 +
 
 +
''Output:''
 +
:* {{{{BASEPAGENAME}} | id= 21614 | name= Sidney Crosby }}
 +
 
 +
=== No parameters and Wikidata property not defined ===
 +
''Usage:''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
 
 +
''Output:''
 +
:* {{ {{BASEPAGENAME}} }}
  
 
== TemplateData ==
 
== TemplateData ==
Line 46: Line 80:
 
</templatedata>
 
</templatedata>
  
==See also==
+
== See also ==
{{tl|Legendsmember}} for NHL players inducted into the [[Hockey Hall of Fame]]
+
* {{tl|Legendsmember}} for NHL players inducted into the [[Hockey Hall of Fame]]
  
<includeonly>
+
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
+
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Ice hockey external link templates|Legendsofhockey.net]]
+
[[Category:Ice hockey external link templates]]
 +
[[Category:People and person external link templates]]
 
[[Category:External link templates using Wikidata]]
 
[[Category:External link templates using Wikidata]]
[[Category:People and person external link templates]]
+
[[Category:WikiProject Ice Hockey templates]]
[[Category:WikiProject Ice Hockey templates|Legendsofhockey.net]]
+
}}</includeonly>
 
 
[[ja:Template:Legendsofhockey]]
 
[[no:Mal:Legendsofhockey]]
 
</includeonly>
 

Revision as of 08:49, 18 September 2018

Template:Uses Wikidata

Template:Legendsofhockey 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.

Usage

Unnamed parameters:

{{Legendsofhockey | ID }}
{{Legendsofhockey | ID | NAME }}

Named parameters:

{{Legendsofhockey | id= ID }}
{{Legendsofhockey | id= ID | name= NAME }}

Using Wikidata property Template:Property:

{{Legendsofhockey}}
{{Legendsofhockey | name= NAME }}

Examples

Unnamed parameters

URL:

http://www.legendsofhockey.net/LegendsOfHockey/jsp/SearchPlayer.jsp?player=14279

Usage:

* {{Legendsofhockey | 14279 | Eddie Shack }}

Output:

Named parameters

URL:

http://www.legendsofhockey.net/LegendsOfHockey/jsp/SearchPlayer.jsp?player=21614

Usage:

* {{Legendsofhockey | id= 21614 | name= Sidney Crosby }}

Output:

No parameters and Wikidata property not defined

Usage:

* {{Legendsofhockey}}

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 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.legendsofhockey.net/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