Difference between revisions of "Template:Basketballstats/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
(update WNBA url)
imported>Zyxw
(update to use Wikidata property if no ID in template)
Line 1: Line 1:
{{#if: {{{nba|}}}{{{bbr|}}}
+
{{#if:{{{nba|{{#property:P3647}}}}}{{{bbr|{{#property:P2685}}}}}
    |*Career statistics and player information from {{#if:{{{nba|}}}
+
|*Career statistics and player information from {{#if:{{{nba|}}}
      |[{{ifnumber|{{{nba}}}|https://stats.nba.com/player/{{{nba}}}/|{{#ifeq:{{str find|{{{nba}}}|/}}|-1|https://www.nba.com/playerfile/{{lc:{{{nba}}}}}|https://www.nba.com/players/{{{nba}}}}}}} NBA.com]{{#if:{{{bbr|}}}|, or 
+
  |[{{ifnumber|{{{nba}}}|https://stats.nba.com/player/{{{nba}}}/|{{#ifeq:{{str find|{{{nba}}}|/}}|-1|https://www.nba.com/playerfile/{{lc:{{{nba}}}}}|https://www.nba.com/players/{{{nba}}}}}}} NBA.com]
        }}<!-- #if:{{{bbr|}}} -->
+
  |{{#if:{{#property:P3647}}|[https://stats.nba.com/player/{{First word|1={{#property:P3647}}|sep=,}}/ NBA.com]{{EditAtWikidata|pid=P3647}}}}
      }}<!-- #if:{{{nba}}} -->{{#if:{{{bbr|}}}
+
  }}{{#if:{{{bbr|{{#property:P2685}}}}}
    |[https://www.basketball-reference.com/players/{{{bbr}}}.html Basketball-Reference.com]
+
  |{{#if:{{{nba|{{#property:P3647}}}}}|, or&nbsp;}}[https://www.basketball-reference.com/players/{{#if: {{{bbr|}}} | {{{bbr}}} | {{First word|1={{#property:P2685}}|sep=,}} }}.html Basketball-Reference.com]{{EditAtWikidata|pid=P2685|{{{bbr|}}}}}
    }}<!-- {{#if:{{{bbr|}}} -->
+
   }}
   }}<!--{{#if: {{{nba|}}}{{{bbr|}}}
+
}}{{#if:{{{wnba|{{#property:P3588}}}}}{{{wbbr|{{#property:P4561}}}}}
-->{{#if: {{{wnba|}}}{{{wbbr|}}}
+
|*Career statistics and player information from {{#if:{{{wnba|}}}
    |*Career statistics and player information from {{#if:{{{wnba|}}}
+
  |[{{ifnumber|{{{wnba}}}|https://stats.wnba.com/player/{{{wnba}}}/|https://www.wnba.com/player/{{{wnba}}}/}} WNBA.com]
      |[{{ifnumber|{{{wnba}}}|https://stats.wnba.com/player/{{{wnba}}}/|https://www.wnba.com/player/{{{wnba}}}/}} WNBA.com]{{#if:{{{wbbr|}}}|, or&nbsp;
+
  |{{#if:{{#property:P3588}}|[https://www.wnba.com/player/{{First word|1={{#property:P3588}}|sep=,}}/ WNBA.com]{{EditAtWikidata|pid=P3588}}}}
        }}<!-- #if:{{{wbbr|}}} -->
+
  }}{{#if:{{{wbbr|{{#property:P4561}}}}}
      }}<!-- #if:{{{wnba}}} -->{{#if:{{{wbbr|}}}
+
  |{{#if:{{{wnba|{{#property:P3588}}}}}|, or&nbsp;}}[https://www.basketball-reference.com/wnba/players/{{#if: {{{wbbr|}}} | {{{wbbr}}} | {{First word|1={{#property:P4561}}|sep=,}} }}.html Basketball-Reference.com]{{EditAtWikidata|pid=P4561|{{{wbbr|}}}}}
    |[https://www.basketball-reference.com/wnba/players/{{{wbbr}}}.html Basketball-Reference.com]
+
   }}
    }}<!-- {{#if:{{{wbbr|}}} -->
+
}}<noinclude>
   }}<!--{{#if: {{{wnba|}}}{{{wbbr|}}}--><noinclude>
 
 
 
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 04:13, 6 October 2020

  • Career statistics and player information from NBA.comScript error: No such module "EditAtWikidata"., or Basketball-Reference.comScript error: No such module "EditAtWikidata".
  • Career statistics and player information from WNBA.comScript error: No such module "EditAtWikidata"., or Basketball-Reference.comScript error: No such module "EditAtWikidata".
50px Template documentation[view] [edit] [history] [purge]

Template:Uses Wikidata

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.
    • For active players, you may use the player's name, all lowercase, with hyphens replacing spaces. URL: https://www.wnba.com/player/first-last/
    • For retired/historical players, you must use the player's ID number as it appears the end of the URL: https://stats.wnba.com/player/12345/.
  • 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 }}
* {{Basketballstats |bbr= j/jamesle01 }}
* {{Basketballstats |nba= lebron_james |bbr= j/jamesle01 }}

Output

  • Career statistics and player information from NBA.comScript error: No such module "EditAtWikidata". or Basketball-Reference.comScript error: No such module "EditAtWikidata".
  • Career statistics and player information from WNBA.comScript error: No such module "EditAtWikidata". or Basketball-Reference.comScript error: No such module "EditAtWikidata".

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 }}
* {{Basketballstats |bbr= c/curryst01 }}
* {{Basketballstats |nba= stephen/curry/201939 |bbr= c/curryst01 }}

Output

  • Career statistics and player information from NBA.comScript error: No such module "EditAtWikidata". or Basketball-Reference.comScript error: No such module "EditAtWikidata".
  • Career statistics and player information from WNBA.comScript error: No such module "EditAtWikidata". or Basketball-Reference.comScript error: No such module "EditAtWikidata".

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 }}
* {{Basketballstats |bbr= a/abdulka01 }}
* {{Basketballstats |nba= 76003 |bbr= a/abdulka01 }}

Output

  • Career statistics and player information from NBA.comScript error: No such module "EditAtWikidata". or Basketball-Reference.comScript error: No such module "EditAtWikidata".
  • Career statistics and player information from WNBA.comScript error: No such module "EditAtWikidata". or Basketball-Reference.comScript error: No such module "EditAtWikidata".

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 }}
* {{Basketballstats |wbbr= y/youngso01w }}
* {{Basketballstats |wnba= sophia-young |wbbr= y/youngso01w }}

Output

  • Career statistics and player information from NBA.comScript error: No such module "EditAtWikidata". or Basketball-Reference.comScript error: No such module "EditAtWikidata".
  • Career statistics and player information from WNBA.comScript error: No such module "EditAtWikidata". or Basketball-Reference.comScript error: No such module "EditAtWikidata".

URLs

https://www.wnba.com/player/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 }}
* {{Basketballstats |wbbr= h/hallvi01w }}
* {{Basketballstats |wnba= 100458 |wbbr= h/hallvi01w }}

Output

  • Career statistics and player information from NBA.comScript error: No such module "EditAtWikidata". or Basketball-Reference.comScript error: No such module "EditAtWikidata".
  • Career statistics and player information from WNBA.comScript error: No such module "EditAtWikidata". or Basketball-Reference.comScript error: No such module "EditAtWikidata".

URLs

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

See also