Difference between revisions of "Template:Hockey-reference"

From blackwiki
Jump to navigation Jump to search
imported>Elegie
(Use HTTPS for Hockey-Reference.com links in order to provide increased user privacy/security)
imported>Zyxw
m (Fixes for empty id/name parameters. Remove {{Trim|}} since {{#if:}} does same. If Wikidata property has multiple values, only use first one.)
 
Line 1: Line 1:
 
{{#if: {{{1<includeonly>|</includeonly>}}} {{{id|}}} {{#property:P3598}}
 
{{#if: {{{1<includeonly>|</includeonly>}}} {{{id|}}} {{#property:P3598}}
|[https://www.hockey-reference.com/players/{{Trim|{{{1|{{{id<includeonly>|{{#property:P3598}}</includeonly>}}}}}}}}{{#ifeq:{{Str rightc|{{{1|{{{id}}}}}}|5}}|.html||.html}} {{#if:{{{2|{{{name<includeonly>|</includeonly>}}}}}}|{{{2|{{{name}}}}}}|{{PAGENAMEBASE}}}}] at [https://www.hockey-reference.com/ Hockey-Reference.com]<includeonly>{{EditAtWikidata|pid=3598|{{{1|{{{id|}}}}}}}}</includeonly>
+
| [https://www.hockey-reference.com/players/{{#if: {{{1|{{{id<includeonly>|</includeonly>}}}}}} | {{{1|{{{id}}}}}} | {{First word|1={{#property:P3598}}|sep=,}} }}{{#ifeq:{{Str rightc|{{{1|{{{id}}}}}}|5}}|.html||.html}} {{#if: {{{2|{{{name<includeonly>|</includeonly>}}}}}} | {{{2|{{{name}}}}}} | {{PAGENAMEBASE}} }}] at [https://www.hockey-reference.com/ Hockey-Reference.com]<includeonly>{{EditAtWikidata|pid=3598|{{{1|{{{id|}}}}}}}}</includeonly>
|<span class="error">&#123;&#123;[[Template:Hockey-reference|Hockey-reference]]&#125;&#125; template missing ID and not present in Wikidata.</span>
+
| <span class="error">&#123;&#123;[[Template:Hockey-reference|Hockey-reference]]&#125;&#125; template missing ID and not present in Wikidata.</span>
 
}}<noinclude>
 
}}<noinclude>
 
{{Documentation}}<!-- Please add categories to the /doc subpage & add interwikis to Wikidata. -->
 
{{Documentation}}<!-- Please add categories to the /doc subpage & add interwikis to Wikidata. -->
 
</noinclude>
 
</noinclude>

Latest revision as of 09:52, 18 September 2018

{{{name}}} at Hockey-Reference.com

Template documentation[view] [edit] [history] [purge]

Template:Uses Wikidata Lua error in Module:Lua_banner at line 113: attempt to index field 'edit' (a nil value).

Template:Hockey-reference displays an external link to an ice hockey player's profile at Hockey-Reference.com. It is intended for use in the external links section of an article.

Usage

Unnamed parameters:

{{Hockey-reference | ID }}
{{Hockey-reference | ID | NAME }}

Named parameters:

{{Hockey-reference | id= ID }}
{{Hockey-reference | id= ID | name= NAME }}

Using Wikidata property P3598:

{{Hockey-reference}}
{{Hockey-reference | name= NAME }}

Examples

Unnamed parameters

URL:

https://www.hockey-reference.com/players/k/kanepa01.html

Usage:

* {{Hockey-reference | k/kanepa01 | Patrick Kane }}

Output:

Named parameters

URL:

https://www.hockey-reference.com/players/s/staaler01.html

Usage:

* {{Hockey-reference | id= s/staaler01 | name= Eric Staal }}

Output:

No parameters and Wikidata property not defined

Usage:

* {{Hockey-reference}}

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 Hockey-reference

This template displays an external link to an ice hockey player's profile at Hockey-Reference.com. 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: k/kanepa01 is the ID portion of https://www.hockey-reference.com/players/k/kanepa01.html. This parameter is optional if Wikidata property P3598 exists, but required if not.

Default
Wikidata property P3598
Stringoptional
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