Difference between revisions of "Template:ESPNscrum/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
(→‎See also: update)
imported>Zyxw
(updates for use of Wikidata property)
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 -->
{{Wikidata property|P858}}
+
{{Uses Wikidata|P858}}
 +
{{Lua|Module:EditAtWikidata}}
  
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a [[rugby union]] player's page at the [[ESPNscrum]] website.
+
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a [[rugby union]] player's page at the [[ESPNscrum]] website. It is intended for use in the [[Wikipedia:External links|external links]] section of an article.
  
 
== Usage ==
 
== Usage ==
One parameter:
+
; Unnamed parameters
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
 
: <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'' }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
 +
 +
; Using [[Wikidata]] property {{WPL|id=o|P858}}
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
 +
 +
== Examples ==
 +
 +
=== Unnamed parameters ===
 +
; URLs
 +
: <kbd>[http://stats.espnscrum.com/statsguru/rugby/player/13784.html http://stats.espnscrum.com/statsguru/rugby/player/{{hilite|13784}}.html]</kbd>
 +
: <kbd>[http://en.espn.co.uk/scrum/rugby/player/13784.html http://en.espn.co.uk/scrum/rugby/player/{{hilite|13784}}.html]</kbd>
 +
 +
; Usage
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | 13784 | Richie McCaw }}</code>
 +
 +
; Output
 +
: {{{{BASEPAGENAME}} | 13784 | Richie McCaw }}
 +
 +
=== Named parameters ===
 +
; URLs
 +
: <kbd>[http://stats.espnscrum.com/statsguru/rugby/player/91492.html http://stats.espnscrum.com/statsguru/rugby/player/{{hilite|91492}}.html]</kbd>
 +
: <kbd>[http://en.espn.co.uk/scrum/rugby/player/91492.html http://en.espn.co.uk/scrum/rugby/player/{{hilite|91492}}.html]</kbd>
 +
 +
; Usage
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} |id= 91492 |name= Duane Vermeulen }}</code>
  
Two parameters:
+
; Output
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''NAME'' }}</code>
+
: {{{{BASEPAGENAME}} |id= 91492 |name= Duane Vermeulen }}
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
+
 
 +
=== No parameters and Wikidata property not defined ===
 +
; Usage
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
 
 +
; Output
 +
: {{ {{BASEPAGENAME}} }}
  
 
== TemplateData ==
 
== TemplateData ==
{{TemplateDataHeader}}
+
{{TemplateData header}}
 
<templatedata>
 
<templatedata>
 
{
 
{
   "description": "This template displays an external link to a rugby union player's page at the ESPNscrum website.",
+
   "description": "This template displays an external link to a rugby union player's page at the ESPNscrum website. It is intended for use in the external links section of an article.",
 
   "params": {
 
   "params": {
     "1": {
+
     "id": {
       "label": "ID",
+
       "label": "id",
       "aliases": ["id"],  
+
       "aliases": ["1"],  
       "description": "ID portion of URL for rugby union player's ESPNscrum page. Example: 13784 is the ID portion of http://en.espn.co.uk/scrum/rugby/player/13784.html",
+
       "description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL. Example: 13784 is the ID portion of http://stats.espnscrum.com/statsguru/rugby/player/13784.html or http://en.espn.co.uk/scrum/rugby/player/13784.html. This parameter is optional if Wikidata property P858 exists, but required if not.",
 
       "type": "number",
 
       "type": "number",
       "default": "",
+
       "required": false,
       "required": true
+
       "default": "Wikidata property P858"
 
     },
 
     },
     "2": {
+
     "name": {
       "label": "Name",
+
       "label": "name",
       "aliases": ["name"],  
+
       "aliases": ["2"],  
       "description": "Name of rugby union player. If not given it defaults to the Wikipedia article name, without any disambiguation such as (rugby union).",
+
       "description": "The \"name\" parameter (or unnamed parameter \"2\") may be used to specify the link text, which should be the name of the rugby union player. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as \"(rugby union)\".",
 
       "type": "string",
 
       "type": "string",
       "default": "{{PAGENAMEBASE}}",
+
      "required": false,
      "required": false
+
       "default": "{{PAGENAMEBASE}}"
 
     }
 
     }
   }
+
   },
 +
  "paramOrder": [
 +
    "id",
 +
    "name"
 +
  ]
 
}
 
}
 
</templatedata>
 
</templatedata>
 
== Examples ==
 
One parameter:
 
: [[Richie McCaw]]:
 
: <code><nowiki>http://</nowiki>en.espn.co.uk/scrum/rugby/player/{{hilite|13784}}.html</code>
 
# <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | 13784 }}</code>
 
#: {{{{BASEPAGENAME}} | 13784 }}
 
# <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= 13784 }}</code>
 
#: {{{{BASEPAGENAME}} | id= 13784 }}
 
 
Two parameters:
 
: [[Duane Vermeulen]]:
 
: <code><nowiki>http://</nowiki>en.espn.co.uk/scrum/rugby/player/{{hilite|91492}}.html</code>
 
# <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | 91492 |Duane Vermeulen }}</code>
 
#: {{{{BASEPAGENAME}} | 91492 | Duane Vermeulen }}
 
# <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= 91492 | name= Duane Vermeulen }}</code>
 
#: {{{{BASEPAGENAME}} | id= 91492 | name= Duane Vermeulen }}
 
  
 
== See also ==
 
== See also ==
Line 64: Line 87:
 
* {{tl|ESPNcricinfo}}
 
* {{tl|ESPNcricinfo}}
  
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
+
== External links ==
<!-- Categories below this line, please; interwikis at Wikidata -->
+
* [http://stats.espnscrum.com/statsguru/rugby/stats/analysis.html Player search page at ESPNscrum.com]
 +
* [http://en.espn.co.uk/scrum/rugby/player/index.html Player search page at ESPN.co.uk/scrum]
 +
 
 +
<includeonly>{{sandbox other||
 +
<!--Categories below this line, please; interwikis at Wikidata-->
 
[[Category:People and person external link templates]]
 
[[Category:People and person external link templates]]
 
[[Category:Rugby union external link templates]]
 
[[Category:Rugby union external link templates]]
 
+
[[Category:External link templates using Wikidata]]
 
}}</includeonly>
 
}}</includeonly>

Revision as of 01:54, 11 August 2017

Template:Uses Wikidata

Template:ESPNscrum displays an external link to a rugby union player's page at the ESPNscrum website. It is intended for use in the external links section of an article.

Usage

Unnamed parameters
{{ESPNscrum | ID }}
{{ESPNscrum | ID | NAME }}
Named parameters
{{ESPNscrum | id= ID }}
{{ESPNscrum | id= ID | name= NAME }}
Using Wikidata property Template:WPL
{{ESPNscrum}}
{{ESPNscrum | name= NAME }}

Examples

Unnamed parameters

URLs
http://stats.espnscrum.com/statsguru/rugby/player/13784.html
http://en.espn.co.uk/scrum/rugby/player/13784.html
Usage
{{ESPNscrum | 13784 | Richie McCaw }}
Output
Richie McCaw at ESPNscrumScript error: No such module "EditAtWikidata".

Named parameters

URLs
http://stats.espnscrum.com/statsguru/rugby/player/91492.html
http://en.espn.co.uk/scrum/rugby/player/91492.html
Usage
{{ESPNscrum |id= 91492 |name= Duane Vermeulen }}
Output
Duane Vermeulen at ESPNscrumScript error: No such module "EditAtWikidata".

No parameters and Wikidata property not defined

Usage
{{ESPNscrum}}
Output
Template:PAGENAMEBASE at ESPNscrumScript 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 ESPNscrum

This template displays an external link to a rugby union player's page at the ESPNscrum website. 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: 13784 is the ID portion of http://stats.espnscrum.com/statsguru/rugby/player/13784.html or http://en.espn.co.uk/scrum/rugby/player/13784.html. This parameter is optional if Wikidata property P858 exists, but required if not.

Default
Wikidata property P858
Numberoptional
namename 2

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

Default
{{PAGENAMEBASE}}
Stringoptional

See also

Other ESPN external link templates:

External links