Difference between revisions of "Template:Eurohockey"

From blackwiki
Jump to navigation Jump to search
imported>Djsasso
(adjust back to match EL style for hockey stat sites)
imported>Zyxw
(Update handling of missing ID, previous placement of category prevented it from being included. Trim any leading or trailing spaces from "id" that would break URL. Allow "name". Move {{Uses Wikidata}} to /doc.)
Line 1: Line 1:
[http://www.eurohockey.com/player/{{{1|{{{id|{{#property:P2601|[[Category:Eurohockey template with no id set]]}}}}}}}}.html {{{2|{{PAGENAME}}}}} profile] at [http://www.eurohockey.com Eurohockey.com]<noinclude>
+
{{#if: {{{1<includeonly>|</includeonly>}}} {{{id|}}} {{#property:P2601}}
 
+
|[http://www.eurohockey.com/player/{{Trim|{{{1|{{{id<includeonly>|{{#property:P2601}}</includeonly>}}}}}}}}.html {{#if:{{{2|{{{name<includeonly>|</includeonly>}}}}}}|{{{2|{{{name}}}}}}|{{PAGENAMEBASE}}}} profile] at [http://www.eurohockey.com Eurohockey.com]
{{Uses Wikidata|P2601}}
+
|<span class="error">&#123;&#123;[[Template:Eurohockey|Eurohockey]]&#125;&#125; template missing ID and not present in Wikidata.</span>{{Main other|[[Category:Eurohockey template missing ID]]}}
{{documentation}}
+
}}<noinclude>
 
+
{{Documentation}}
 +
<!-- Please add categories to the /doc subpage & add interwikis to Wikidata. -->
 
</noinclude>
 
</noinclude>

Revision as of 10:03, 24 February 2017

{{{name}}} profile at Eurohockey.com

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

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

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

Usage

Unnamed parameters:

{{Eurohockey | ID }}
{{Eurohockey | ID | NAME }}

Named parameters:

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

Using Wikidata property P2601:

{{Eurohockey}}
{{Eurohockey | name= NAME }}

Examples

Unnamed parameters

URL:

http://www.eurohockey.com/player/8470-teemu-selnne.html

Usage:

* {{Eurohockey | 8470-teemu-selnne | Teemu Selänne }}
* {{Eurohockey | 8470 | Teemu Selänne }}

Output:

Named parameters

URL:

http://www.eurohockey.com/player/10689-jaromir-jagr.html

Usage:

* {{Eurohockey | id= 10689-jaromir-jagr | name= Jaromír Jágr }}
* {{Eurohockey | id= 10689 | name= Jaromír Jágr }}

Output:

No parameters and Wikidata property not defined

Usage:

* {{Eurohockey}}

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 Eurohockey

This template displays an external link to an ice hockey player's profile at Eurohockey.com. It is intended for use in the external links section of an article.

Template parameters

ParameterDescriptionTypeStatus
idid 1

The "id" parameter (or unnamed parameter "1") should contain the ID portion of the URL. Example: 8470-teemu-selnne is the ID portion of http://www.eurohockey.com/player/8470-teemu-selnne.html. This parameter is optional if Wikidata property P2601 exists, but required if not.

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

Tracking categories

"id" parameter exists
"id" parameter does not exist

See also