Difference between revisions of "Template:BWF2/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
m (Since <tt> is obsolete in HTML5, replace it with <kbd> – see HTML element#tt, Wikipedia:HTML5, and mw:Help:Extension:Linter/obsolete-tag. using AWB)
imported>Zyxw
(update URL and examples)
Line 8: Line 8:
  
 
== Usage ==
 
== Usage ==
Unnamed parameters:
+
; Unnamed parameters
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''NAME'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''NAME'' }}</code>
  
Named parameters:
+
; 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>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
  
Using [[Wikidata]] property [[d:Property:P3620|P3620]]:
+
; Using [[Wikidata]] property {{Property|3620|id=first}}
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
Line 23: Line 23:
  
 
=== Unnamed parameters ===
 
=== Unnamed parameters ===
''URL:''
+
; URL
: <kbd>[http://bwfbadminton.com/player/64643/li-xuerui http://bwfbadminton.com/player/{{hilite|64643/li-xuerui}}]</kbd>
+
: <kbd>[https://bwfbadminton.com/player/64643/li-xuerui https://bwfbadminton.com/player/{{hilite|64643}}]</kbd>
''Usage:''
+
: <kbd>[https://bwfbadminton.com/player/64643/li-xuerui https://bwfbadminton.com/player/{{hilite|64643/li-xuerui}}]</kbd>
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | 64643/li-xuerui | Li Xuerui }}</code>
+
 
''Output:''
+
; Usage
: {{{{BASEPAGENAME}} | 64643/li-xuerui | Li Xuerui }}
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 64643 | Li Xuerui }}</code>
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 64643/li-xuerui | Li Xuerui }}</code>
 +
 
 +
; Output
 +
:* {{{{BASEPAGENAME}} | 64643 | Li Xuerui }}
 +
:* {{{{BASEPAGENAME}} | 64643/li-xuerui | Li Xuerui }}
  
 
=== Named parameters ===
 
=== Named parameters ===
''URL:''
+
; URL
: <kbd>[http://bwfbadminton.com/player/50906/lin-dan http://bwfbadminton.com/player/{{hilite|50906/lin-dan}}]</kbd>
+
: <kbd>[https://bwfbadminton.com/player/50906 https://bwfbadminton.com/player/{{hilite|50906}}]</kbd>
''Usage:''
+
: <kbd>[https://bwfbadminton.com/player/50906/lin-dan https://bwfbadminton.com/player/{{hilite|50906/lin-dan}}]</kbd>
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} |id= 50906/lin-dan |name= Lin Dan }}</code>
+
 
''Output:''
+
; Usage
: {{{{BASEPAGENAME}} |id= 50906/lin-dan |name= Lin Dan }}
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} |id= 50906 |name= Lin Dan }}</code>
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} |id= 50906/lin-dan |name= Lin Dan }}</code>
 +
 
 +
; Output
 +
:* {{{{BASEPAGENAME}} |id= 50906 |name= Lin Dan }}
 +
:* {{{{BASEPAGENAME}} |id= 50906/lin-dan |name= Lin Dan }}
  
 
=== No parameters and Wikidata property not defined ===
 
=== No parameters and Wikidata property not defined ===
''Usage:''
+
; Usage
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
''Output:''
+
 
: {{ {{BASEPAGENAME}} }}
+
; Output
 +
:* {{ {{BASEPAGENAME}} }}
  
 
== TemplateData ==
 
== TemplateData ==
Line 53: Line 64:
 
       "label": "id",
 
       "label": "id",
 
       "aliases": ["1"],  
 
       "aliases": ["1"],  
       "description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL. Example: 64643/li-xuerui is the ID portion of http://bwfbadminton.com/player/64643/li-xuerui. This parameter is optional if Wikidata property P3620 exists, but required if not.",
+
       "description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL. Example: 64643 or 64643/li-xuerui is the ID portion of https://bwfbadminton.com/player/64643/li-xuerui. This parameter is optional if Wikidata property P3620 exists, but required if not.",
 
       "type": "string",
 
       "type": "string",
 
       "required": false,
 
       "required": false,
Line 84: Line 95:
  
 
== See also ==
 
== See also ==
* {{tl|BWF}} – generates an external link to a player's profile at BWFbadminton.org
+
* {{tl|BWF}} – generates an external link to a player's profile at BWF.tournamentsoftware.com
  
 
== External links ==
 
== External links ==
* [http://bwfbadminton.com/players/ Players search at BWFbadminton.com]
+
* [https://bwfbadminton.com/players/ Players search at BWFbadminton.com]
  
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||

Revision as of 04:38, 27 December 2018

Template:Uses Wikidata Template:Tracks Wikidata

Template:BWF2 displays an external link to a badminton player's profile at BWFbadminton.com, an official website of the Badminton World Federation (BWF). It is intended for use in the external links section of an article.

Usage

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

Examples

Unnamed parameters

URL
https://bwfbadminton.com/player/64643
https://bwfbadminton.com/player/64643/li-xuerui
Usage
* {{BWF2 | 64643 | Li Xuerui }}
* {{BWF2 | 64643/li-xuerui | Li Xuerui }}
Output

Named parameters

URL
https://bwfbadminton.com/player/50906
https://bwfbadminton.com/player/50906/lin-dan
Usage
* {{BWF2 |id= 50906 |name= Lin Dan }}
* {{BWF2 |id= 50906/lin-dan |name= Lin Dan }}
Output

No parameters and Wikidata property not defined

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

This template displays an external link to a badminton player's profile at BWFbadminton.com, an official website of the Badminton World Federation (BWF). 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: 64643 or 64643/li-xuerui is the ID portion of https://bwfbadminton.com/player/64643/li-xuerui. This parameter is optional if Wikidata property P3620 exists, but required if not.

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

Default
{{PAGENAMEBASE}}
Stringoptional

Tracking categories

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

See also

  • {{BWF}} – generates an external link to a player's profile at BWF.tournamentsoftware.com

External links