Difference between revisions of "Template:Basketballstats/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
m (additional properties available)
imported>Zyxw
m (update examples)
Line 10: Line 10:
 
==Usage==
 
==Usage==
 
This template takes up to two parameters:
 
This template takes up to two parameters:
 +
 +
===NBA===
 
* '''nba''', for [[National Basketball Association]] (NBA) players (active or retired):
 
* '''nba''', for [[National Basketball Association]] (NBA) players (active or retired):
**For active players, you may use the player's name, all lowercase, with underscores replacing spaces (see example below), or you may use the ID which appears at the end of the URL: <code><nowiki>http://www.nba.com/players/</nowiki>'''first/last/12345'''</code>
+
** For active players, you may use the player's name, all lowercase, with underscores replacing spaces (URL: <code><nowiki>https://www.nba.com/playerfile/</nowiki>'''first_last'''</code>) or you may use the ID which appears at the end of the URL: <code><nowiki>https://www.nba.com/players/</nowiki>'''first/last/12345'''</code>
**For retired/historical players, you must use the player's ID number as it appears the end of the URL: <code><nowiki>http://stats.nba.com/player/</nowiki>'''12345'''/</code>. The URL may have <code>career/</code> at the end, which may be ignored.
+
** For retired/historical players, you must use the player's ID number as it appears the end of the URL: <code><nowiki>https://stats.nba.com/player/</nowiki>'''12345'''/</code>. The URL may have <code>career/</code> at the end, which may be ignored.
 
* '''bbr''', for NBA or [[American Basketball Association|original American Basketball Association]] players, the id as it appears after <code><nowiki>https://www.basketball-reference.com/players/</nowiki></code> and before <code>.html</code> in its Basketball-Reference.com player page URL
 
* '''bbr''', for NBA or [[American Basketball Association|original American Basketball Association]] players, the id as it appears after <code><nowiki>https://www.basketball-reference.com/players/</nowiki></code> and before <code>.html</code> in its Basketball-Reference.com player page URL
* '''wnba''', for [[Women's National Basketball Association]] (WNBA) players. The id is with few exceptions the player's name, all lowercase, with hyphens replacing spaces.
+
 
 +
===WNBA===
 +
* '''wnba''', for [[Women's National Basketball Association]] (WNBA) players. The id is with few exceptions the player's name, all lowercase, with hyphens replacing spaces. URL: <code><nowiki>https://www.wnba.com/player/</nowiki>'''first-last'''/</code>
 
* '''wbbr''', for WNBA players, the id as it appears after <code><nowiki>https://www.basketball-reference.com/wnba/players/</nowiki></code> and before <code>.html</code> in its Basketball-Reference.com player page URL
 
* '''wbbr''', for WNBA players, the id as it appears after <code><nowiki>https://www.basketball-reference.com/wnba/players/</nowiki></code> and before <code>.html</code> in its Basketball-Reference.com player page URL
  
 
==Examples==
 
==Examples==
;NBA player [[LeBron James]] (using name – lowercase, replace spaces with underscores):
 
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki> |nba= lebron_james |bbr= j/jamesle01 }}</nowiki></code>
 
{{{{BASEPAGENAME}} |nba= lebron_james |bbr= j/jamesle01 }}
 
  
;NBA player [[Stephen Curry]] (using ID from URL):
+
===NBA===
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki> |nba= stephen/curry/201939 |bbr= c/curryst01 }}</nowiki></code>
+
; NBA player [[LeBron James]] (using name – lowercase, replace spaces with underscores):
{{{{BASEPAGENAME}} |nba= stephen/curry/201939 |bbr= c/curryst01 }}
+
''Usage''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki> |nba= lebron_james |bbr= j/jamesle01 }}</nowiki></code>
 +
''Output''
 +
:* {{{{BASEPAGENAME}} |nba= lebron_james |bbr= j/jamesle01 }}
 +
''URLs''
 +
: <kbd>[https://www.nba.com/playerfile/lebron_james https://www.nba.com/playerfile/{{Highlight|lebron_james}}]</kbd>
 +
: <kbd>[https://www.basketball-reference.com/players/j/jamesle01.html https://www.basketball-reference.com/players/{{Highlight|j/jamesle01}}.html]</kbd>
 +
 
 +
; NBA player [[Stephen Curry]] (using ID from URL):
 +
''Usage''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki> |nba= stephen/curry/201939 |bbr= c/curryst01 }}</nowiki></code>
 +
''Output''
 +
:* {{{{BASEPAGENAME}} |nba= stephen/curry/201939 |bbr= c/curryst01 }}
 +
''URLs''
 +
: <kbd>[https://www.nba.com/players/stephen/curry/201939 https://www.nba.com/players/{{Highlight|stephen/curry/201939}}]</kbd>
 +
: <kbd>[https://www.basketball-reference.com/players/c/curryst01.html https://www.basketball-reference.com/players/{{Highlight|c/curryst01}}.html]</kbd>
 +
 
 +
; Retired NBA player [[Kareem Abdul-Jabbar]] (must use ID number):
 +
''Usage''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki> |nba= 76003 |bbr= a/abdulka01 }}</nowiki></code>
 +
''Output''
 +
:* {{{{BASEPAGENAME}} |nba= 76003 |bbr= a/abdulka01 }}
 +
''URLs''
 +
: <kbd>[https://stats.nba.com/player/76003/ https://stats.nba.com/player/{{Highlight|76003}}/]</kbd>
 +
: <kbd>[https://www.basketball-reference.com/players/a/abdulka01.html https://www.basketball-reference.com/players/{{Highlight|a/abdulka01}}.html]</kbd>
  
;Retired NBA player [[Kareem Abdul-Jabbar]] (must use ID number):
+
===WNBA===
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki> |nba= 76003 |bbr= a/abdulka01 }}</nowiki></code>
+
; Current WNBA player [[Sophia Young]] (using name – lowercase, replace spaces with hyphens):
{{{{BASEPAGENAME}} |nba= 76003 |bbr= a/abdulka01 }}
+
''Usage''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki> |wnba= sophia-young |wbbr= y/youngso01w }}</nowiki></code>
 +
''Output''
 +
:* {{{{BASEPAGENAME}} |wnba= sophia-young |wbbr= y/youngso01w }}
 +
''URLs''
 +
: <kbd>[https://www.wnba.com/playerfile/sophia-young https://www.wnba.com/playerfile/{{Highlight|sophia-young}}]</kbd>
 +
: <kbd>[https://www.basketball-reference.com/wnba/players/y/youngso01w.html https://www.basketball-reference.com/wnba/players/{{Highlight|y/youngso01w}}.html]</kbd>
  
;WNBA player [[Sophia Young]]
+
; Retired WNBA player [[Vicki Hall]] (must use ID number):
:<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki> |wnba= sophia-young |wbbr= y/youngso01w }}</nowiki></code>
+
''Usage''
{{{{BASEPAGENAME}} |wnba= sophia-young |wbbr= y/youngso01w }}
+
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}}<nowiki> |wnba= 100458 |wbbr= h/hallvi01w }}</nowiki></code>
 +
''Output''
 +
:* {{{{BASEPAGENAME}} |wnba= 100458 |wbbr= h/hallvi01w }}
 +
''URLs''
 +
: <kbd>[https://stats.wnba.com/player/100458/ https://stats.wnba.com/player/{{Highlight|100458}}/]</kbd>
 +
: <kbd>[https://www.basketball-reference.com/wnba/players/h/hallvi01w.html https://www.basketball-reference.com/wnba/players/{{Highlight|h/hallvi01w}}.html]</kbd>
  
 
==See also==
 
==See also==

Revision as of 16:12, 3 October 2020

Template:Wikidata property

Guidelines

This will create an external link to the statistics for a basketball player.

Usage

This template takes up to two parameters:

NBA

  • nba, for National Basketball Association (NBA) players (active or retired):
    • For active players, you may use the player's name, all lowercase, with underscores replacing spaces (URL: https://www.nba.com/playerfile/first_last) or you may use the ID which appears at the end of the URL: https://www.nba.com/players/first/last/12345
    • For retired/historical players, you must use the player's ID number as it appears the end of the URL: https://stats.nba.com/player/12345/. The URL may have career/ at the end, which may be ignored.
  • bbr, for NBA or original American Basketball Association players, the id as it appears after https://www.basketball-reference.com/players/ and before .html in its Basketball-Reference.com player page URL

WNBA

  • wnba, for Women's National Basketball Association (WNBA) players. The id is with few exceptions the player's name, all lowercase, with hyphens replacing spaces. URL: https://www.wnba.com/player/first-last/
  • wbbr, for WNBA players, the id as it appears after https://www.basketball-reference.com/wnba/players/ and before .html in its Basketball-Reference.com player page URL

Examples

NBA

NBA player LeBron James (using name – lowercase, replace spaces with underscores)

Usage

* {{Basketballstats |nba= lebron_james |bbr= j/jamesle01 }}

Output

URLs

https://www.nba.com/playerfile/lebron_james
https://www.basketball-reference.com/players/j/jamesle01.html
NBA player Stephen Curry (using ID from URL)

Usage

* {{Basketballstats |nba= stephen/curry/201939 |bbr= c/curryst01 }}

Output

URLs

https://www.nba.com/players/stephen/curry/201939
https://www.basketball-reference.com/players/c/curryst01.html
Retired NBA player Kareem Abdul-Jabbar (must use ID number)

Usage

* {{Basketballstats |nba= 76003 |bbr= a/abdulka01 }}

Output

URLs

https://stats.nba.com/player/76003/
https://www.basketball-reference.com/players/a/abdulka01.html

WNBA

Current WNBA player Sophia Young (using name – lowercase, replace spaces with hyphens)

Usage

* {{Basketballstats |wnba= sophia-young |wbbr= y/youngso01w }}

Output

URLs

https://www.wnba.com/playerfile/sophia-young
https://www.basketball-reference.com/wnba/players/y/youngso01w.html
Retired WNBA player Vicki Hall (must use ID number)

Usage

* {{Basketballstats |wnba= 100458 |wbbr= h/hallvi01w }}

Output

URLs

https://stats.wnba.com/player/100458/
https://www.basketball-reference.com/wnba/players/h/hallvi01w.html

See also