Difference between revisions of "Template:All Blacks/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>Zyxw
(update documentation and examples, add TemplateData)
blackwiki>Zyxw
(update usage, examples, TemplateData, and categories for use of Wikidata property)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 +
{{Uses Wikidata|P3645}}
 +
{{Lua|Module:EditAtWikidata}}
  
This template generates an external link to a player's page at AllBlacks.com, the website of the [[New Zealand national rugby union team]].
+
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a [[rugby union]] player's page at AllBlacks.com, the website of the [[New Zealand national rugby union team]]. 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 {{Property|3645}}
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
 +
 +
== Examples ==
  
Two parameters:
+
=== Unnamed parameters ===
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''NAME'' }}</code>
+
; URL
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
+
: <kbd>[http://stats.allblacks.com/asp/Profile.asp?ABID=601 http://stats.allblacks.com/asp/Profile.asp?ABID={{hilite|601}}]</kbd>
 +
 
 +
; Usage
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 601 | Colin Meads }}</code>
 +
 
 +
; Output
 +
:* {{{{BASEPAGENAME}} | 601 | Colin Meads }}
 +
 
 +
=== Named parameters ===
 +
; URL
 +
: <kbd>[http://stats.allblacks.com/asp/Profile.asp?ABID=506 http://stats.allblacks.com/asp/Profile.asp?ABID={{hilite|506}}]</kbd>
 +
 
 +
; Usage
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} |id= 506 |name= Jonah Lomu }}</code>
 +
 
 +
; Output
 +
:* {{{{BASEPAGENAME}} |id= 506 |name= Jonah Lomu }}
 +
 
 +
=== No parameters and Wikidata property not defined ===
 +
; Usage
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
 
 +
; Output
 +
:* {{ {{BASEPAGENAME}} }}
  
== Template data ==
+
== TemplateData ==
{{TemplateDataHeader}}
+
{{TemplateData header}}
 
<templatedata>
 
<templatedata>
 
{
 
{
         "description": "This template generates an external link to a player's page at AllBlacks.com, the website of the New Zealand national rugby union team.",
+
         "description": "This template displays an external link to a rugby union player's page at AllBlacks.com, the website of the New Zealand national rugby union team. 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 number used in the URL.",
+
"description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL. Example: 601 is the ID portion of http://stats.allblacks.com/asp/Profile.asp?ABID=601. This parameter is optional if Wikidata property P3645 exists, but required if not.",
 
"type": "number",
 
"type": "number",
"required": true
+
"required": false,
 +
"default": "Wikidata property P3645"
 
},
 
},
"2": {
+
"name": {
 
"label": "Name",
 
"label": "Name",
"aliases": [ "name" ],
+
"aliases": [ "2" ],
"description": "Name displayed in the link text. If not specified it defaults to the article's {{PAGENAME}}, without disambiguation.",
+
"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",
                        "required": false
+
"required": false,
 +
"default": "{{PAGENAMEBASE}}"
 
}
 
}
}
+
},
 +
"paramOrder": [
 +
"id",
 +
"name"
 +
]
 
}
 
}
 
</templatedata>
 
</templatedata>
 
== Examples ==
 
The following examples show a link to the page for [[Colin Meads]]:
 
: <code><nowiki>http://</nowiki>stats.allblacks.com/asp/Profile.asp?ABID={{hilite|601}}</code>
 
 
=== One parameter ===
 
Usage:
 
: <code>{{((}}{{BASEPAGENAME}} {{!}} 601 {{))}}</code>
 
: <code>{{((}}{{BASEPAGENAME}} {{!}} id= 601 {{))}}</code>
 
Results:
 
: {{{{BASEPAGENAME}} | 601 }}
 
: {{{{BASEPAGENAME}} | id= 601 }}
 
 
=== Two parameters ===
 
Usage:
 
: <code>{{((}}{{BASEPAGENAME}} {{!}} 601 {{!}} Colin Meads {{))}}</code>
 
: <code>{{((}}{{BASEPAGENAME}} {{!}} id= 601 {{!}} name= Colin Meads {{))}}</code>
 
Results:
 
: {{{{BASEPAGENAME}} | 601 | Colin Meads }}
 
: {{{{BASEPAGENAME}} | id= 601 | name= Colin Meads }}
 
  
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
Line 62: Line 83:
 
[[Category:Rugby union external link templates]]
 
[[Category:Rugby union external link templates]]
 
[[Category:New Zealand sports templates]]
 
[[Category:New Zealand sports templates]]
 +
[[Category:External link templates using Wikidata]]
 
}}</includeonly>
 
}}</includeonly>

Revision as of 02:38, 30 November 2018

Template:Uses Wikidata

Template:All Blacks displays an external link to a rugby union player's page at AllBlacks.com, the website of the New Zealand national rugby union team. It is intended for use in the external links section of an article.

Usage

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

Examples

Unnamed parameters

URL
http://stats.allblacks.com/asp/Profile.asp?ABID=601
Usage
* {{All Blacks | 601 | Colin Meads }}
Output

Named parameters

URL
http://stats.allblacks.com/asp/Profile.asp?ABID=506
Usage
* {{All Blacks |id= 506 |name= Jonah Lomu }}
Output

No parameters and Wikidata property not defined

Usage
* {{All Blacks}}
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 All Blacks

This template displays an external link to a rugby union player's page at AllBlacks.com, the website of the New Zealand national rugby union team. 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: 601 is the ID portion of http://stats.allblacks.com/asp/Profile.asp?ABID=601. This parameter is optional if Wikidata property P3645 exists, but required if not.

Default
Wikidata property P3645
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