Difference between revisions of "Template:CapFriendly/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
(documentation and categories moved from template to /doc)
 
imported>Zyxw
(Add intro text, remove mention and category related to Wikidata (not available for this website yet), fix URLs and update examples, fix TemplateData, update external links)
 
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
<!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata -->
 
<!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata -->
 +
 +
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a web page about an [[ice hockey]] player at [[CapFriendly]]. It is intended for use in the [[Wikipedia:External links|external links]] section of an article.
 +
 
== Usage ==
 
== Usage ==
 
Unnamed parameters:
 
Unnamed parameters:
Line 13: Line 16:
  
 
=== Unnamed parameters ===
 
=== Unnamed parameters ===
''URLs:''
+
''URL:''
: <kbd>[https://www.capfriendly.com/players/eric-staal https://www.capfriendly.com/ice/players/{{hilite|eric-staal}}]</kbd>
 
 
: <kbd>[https://www.capfriendly.com/players/sidney-crosby https://www.capfriendly.com/players/{{hilite|sidney-crosby}}]</kbd>
 
: <kbd>[https://www.capfriendly.com/players/sidney-crosby https://www.capfriendly.com/players/{{hilite|sidney-crosby}}]</kbd>
: <kbd>[https://www.capfriendly.com/players/daniel-alfredsson https://www.capfriendly.com/players/{{hilite|daniel-alfredsson}}]</kbd>
 
  
 
''Usage:''
 
''Usage:''
Line 25: Line 26:
  
 
=== Named parameters ===
 
=== Named parameters ===
''URLs:''
+
''URL:''
: <kbd>[https://www.capfriendly.com/players/eric-staal https://www.capfriendly.com/ice/players/{{hilite|eric-staal}}]</kbd>
+
: <kbd>[https://www.capfriendly.com/players/sidney-crosby https://www.capfriendly.com/players/{{hilite|eric-staal}}]</kbd>
: <kbd>[https://www.capfriendly.com/players/sidney-crosby https://www.capfriendly.com/players/{{hilite|sidney-crosby}}]</kbd>
 
: <kbd>[https://www.capfriendly.com/players/daniel-alfredsson https://www.capfriendly.com/players/{{hilite|daniel-alfredsson}}]</kbd>
 
 
 
''Usage:''
 
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= sidney-crosby | name= Sidney Crosby <nowiki>}}</nowiki></code>
 
 
 
''Output:''
 
:* {{{{BASEPAGENAME}} | id= sidney-crosby | name= Sidney Crosby }}
 
  
=== No parameters and Wikidata property not defined ===
 
 
''Usage:''
 
''Usage:''
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= eric-staal | name= Eric Staal <nowiki>}}</nowiki></code>
  
 
''Output:''
 
''Output:''
:* {{ {{BASEPAGENAME}} }}
+
:* {{{{BASEPAGENAME}} | id= eric-staal | name= Eric Staal }}
  
 
== TemplateData ==
 
== TemplateData ==
Line 47: Line 39:
 
<templatedata>
 
<templatedata>
 
{
 
{
   "description": "This template displays an external link to an ice hockey player's CapFriendly page. It is intended for use in the external links section of an article.",
+
   "description": "This template displays an external link to a web page about an ice hockey player at CapFriendly. It is intended for use in the external links section of an article.",
 
   "params": {
 
   "params": {
 
     "id": {
 
     "id": {
Line 53: Line 45:
 
       "aliases": ["1"],  
 
       "aliases": ["1"],  
 
       "description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL for the player's profile. Example: sidney-crosby is the ID portion of https://www.capfriendly.com/players/sidney-crosby.",
 
       "description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL for the player's profile. Example: sidney-crosby is the ID portion of https://www.capfriendly.com/players/sidney-crosby.",
       "type": "number",
+
       "type": "string",
       "required": false
+
       "required": true
 
     },
 
     },
 
     "name": {
 
     "name": {
Line 91: Line 83:
  
 
== External links ==
 
== External links ==
* [https://www.nhl.com/player/ Player search page at NHL.com]
+
* [https://www.capfriendly.com/players/ Player search page at CapFriendly.com]
* [http://www.nhl.com/stats/player Player stats page at NHL.com]<!-- does not work with https:// -->
 
  
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||
Line 98: Line 89:
 
[[Category:Ice hockey external link templates]]
 
[[Category:Ice hockey external link templates]]
 
[[Category:People and person external link templates]]
 
[[Category:People and person external link templates]]
[[Category:External link templates using Wikidata]]
 
  
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 06:07, 5 August 2018

Template:CapFriendly displays an external link to a web page about an ice hockey player at CapFriendly. It is intended for use in the external links section of an article.

Usage

Unnamed parameters:

{{CapFriendly | ID }}
{{CapFriendly | ID | NAME }}

Named parameters:

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

Examples

Unnamed parameters

URL:

https://www.capfriendly.com/players/sidney-crosby

Usage:

* {{CapFriendly | sidney-crosby | Sidney Crosby }}

Output:

Named parameters

URL:

https://www.capfriendly.com/players/eric-staal

Usage:

* {{CapFriendly | id= eric-staal | name= Eric Staal }}

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 CapFriendly

This template displays an external link to a web page about an ice hockey player at CapFriendly. 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: sidney-crosby is the ID portion of https://www.capfriendly.com/players/sidney-crosby.

Stringrequired
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

Ice hockey player external link templates:

External links