Difference between revisions of "Template:EPCR profile/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
(moved documentation and categories from main template)
 
imported>Zyxw
(Update usage, examples, and categories for use of Wikidata property. Add TemplateData.)
Line 2: Line 2:
 
<!-- 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 -->
 
{{Template redirect|epcrugby profile}}
 
{{Template redirect|epcrugby profile}}
 +
{{Uses Wikidata|P3666}}
 +
{{Lua|Module:EditAtWikidata}}
 +
 +
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a [[rugby union]] player's page at the [[European Professional Club Rugby]] (EPCR) website. It is intended for use in the [[Wikipedia:External links|external links]] section of an article.
  
 
== Usage ==
 
== Usage ==
Line 11: Line 15:
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
 +
 +
; Using [[Wikidata]] property {{Property|P3666|id=only}}
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
  
 
== Examples ==
 
== Examples ==
; URL
+
 
 +
=== Unnamed parameters ===
 +
; URLs
 
: <kbd>[https://www.epcrugby.com/player?PlayGuid=NN862292 https://www.epcrugby.com/player?PlayGuid={{hilite|NN862292}}]</kbd>
 
: <kbd>[https://www.epcrugby.com/player?PlayGuid=NN862292 https://www.epcrugby.com/player?PlayGuid={{hilite|NN862292}}]</kbd>
 +
: <kbd>[https://www.epcrugby.com/joueur?PlayGuid=NN862292 https://www.epcrugby.com/joueur?PlayGuid={{hilite|NN862292}}]</kbd> (in French)
  
 
; Usage
 
; Usage
 
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | NN862292 | Nicolae Nere }}</code>
 
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | NN862292 | Nicolae Nere }}</code>
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} |id= NN862292 |name= Nicolae Nere }}</code>
 
  
 
; Output
 
; Output
 
:* {{{{BASEPAGENAME}} | NN862292 | Nicolae Nere }}
 
:* {{{{BASEPAGENAME}} | NN862292 | Nicolae Nere }}
:* {{{{BASEPAGENAME}} |id= NN862292 |name= Nicolae Nere }}
+
 
 +
=== Named parameters ===
 +
; URLs
 +
: <kbd>[https://www.epcrugby.com/player?PlayGuid=WC160740 https://www.epcrugby.com/player?PlayGuid={{hilite|WC160740}}]</kbd>
 +
: <kbd>[https://www.epcrugby.com/joueur?PlayGuid=WC160740 https://www.epcrugby.com/joueur?PlayGuid={{hilite|WC160740}}]</kbd> (in French)
 +
 
 +
; Usage
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} |id= WC160740 |name= Will Carling }}</code>
 +
 
 +
; Output
 +
:* {{{{BASEPAGENAME}} |id= WC160740 |name= Will Carling }}
 +
 
 +
=== No parameters and Wikidata property not defined ===
 +
; Usage
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
 
 +
; Output
 +
:* {{ {{BASEPAGENAME}} }}
 +
 
 +
== TemplateData ==
 +
{{TemplateData header}}
 +
<templatedata>
 +
{
 +
        "description": "This template displays an external link to a rugby union player's page at the European Professional Club Rugby (EPCR) website. It is intended for use in the external links section of an article.",
 +
"params": {
 +
"id": {
 +
"label": "ID",
 +
"aliases": [ "1" ],
 +
"description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL. Example: WC160740 is the ID portion of https://www.epcrugby.com/player?PlayGuid=WC160740. This parameter is optional if Wikidata property P3666 exists, but required if not.",
 +
"type": "string",
 +
"required": false,
 +
"default": "Wikidata property P3666"
 +
},
 +
"name": {
 +
"label": "Name",
 +
"aliases": [ "2" ],
 +
"description": "The \"name\" parameter (or unnamed parameter \"2\") may be used to specify the link text, which should be the name of the rugby player. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as \"(rugby)\"",
 +
"type": "string",
 +
"required": false,
 +
"default": "{{PAGENAMEBASE}}"
 +
}
 +
},
 +
"paramOrder": [
 +
"id",
 +
"name"
 +
]
 +
}
 +
</templatedata>
 +
 
 +
== External links ==
 +
* [https://www.epcrugby.com/champions-cup/players/player-search/ Player search at European Professional Club Rugby]
  
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||
Line 28: Line 88:
 
[[Category:Rugby union external link templates]]
 
[[Category:Rugby union 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>

Revision as of 03:46, 1 December 2018

Template:Template redirect Template:Uses Wikidata

Template:EPCR profile displays an external link to a rugby union player's page at the European Professional Club Rugby (EPCR) website. It is intended for use in the external links section of an article.

Usage

Unnamed parameters
{{EPCR profile | ID }}
{{EPCR profile | ID | NAME }}
Named parameters
{{EPCR profile | id= ID }}
{{EPCR profile | id= ID | name= NAME }}
Using Wikidata property Template:Property
{{EPCR profile}}
{{EPCR profile | name= NAME }}

Examples

Unnamed parameters

URLs
https://www.epcrugby.com/player?PlayGuid=NN862292
https://www.epcrugby.com/joueur?PlayGuid=NN862292 (in French)
Usage
* {{EPCR profile | NN862292 | Nicolae Nere }}
Output

Named parameters

URLs
https://www.epcrugby.com/player?PlayGuid=WC160740
https://www.epcrugby.com/joueur?PlayGuid=WC160740 (in French)
Usage
* {{EPCR profile |id= WC160740 |name= Will Carling }}
Output

No parameters and Wikidata property not defined

Usage
* {{EPCR profile}}
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 EPCR profile

This template displays an external link to a rugby union player's page at the European Professional Club Rugby (EPCR) 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: WC160740 is the ID portion of https://www.epcrugby.com/player?PlayGuid=WC160740. This parameter is optional if Wikidata property P3666 exists, but required if not.

Default
Wikidata property P3666
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 rugby player. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as "(rugby)"

Default
{{PAGENAMEBASE}}
Stringoptional

External links