Difference between revisions of "Template:Baseballstats/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
m (note available Wikidata properties related to links generated by template, note Lua module used)
imported>Zyxw
(add categories)
Line 92: Line 92:
 
* {{clc|Pages using baseballstats with numeric value in cube parameter}}
 
* {{clc|Pages using baseballstats with numeric value in cube parameter}}
  
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
+
<includeonly>{{Sandbox other||
 
<!--Categories below this line, please; interwikis at Wikidata-->
 
<!--Categories below this line, please; interwikis at Wikidata-->
 
[[Category:Baseball external link templates]]
 
[[Category:Baseball external link templates]]
 
[[Category:People and person external link templates]]
 
[[Category:People and person external link templates]]
 +
[[Category:External link templates using Wikidata]]
 +
[[Category:Templates using multiple Wikidata external identifiers]]
 
[[Category:Templates containing multiple external links‎]]
 
[[Category:Templates containing multiple external links‎]]
 
[[Category:Templates that add a tracking category]]
 
[[Category:Templates that add a tracking category]]
 
}}</includeonly>
 
}}</includeonly>

Revision as of 22:32, 4 March 2019

Template:Wikidata property

Usage

To use this template, copy and paste this text to a baseball player's external links section:

{{Baseballstats |mlb= |espn= |br= |fangraphs= |cube= |brm= |retro=}}

Add the page ID's after the equals sign to properly direct the links that you desire to have. If you do not specify an ID, the site will not be shown.

Example

Example for Chris Young (outfielder):

{{Baseballstats |mlb= 455759 |espn= 6514 |br= y/youngch04 |fangraphs= 3882 |cube= 134 |brm= young-001chr |retro= Y/Pyounc004 }}

results in:

To find a player's ID, find the player's page on a website and locate a string of numbers or letters in the URL similar to the ones above. That is the player's ID.

Parameters

Parameter Website Wikidata propertyScript error: No such module "If empty". URL
|mlb= MLB.com P3541 https://mlb.mlb.com/team/player.jsp?player_id={{{mlb}}}
|espn= ESPN.com P3571 http://www.espn.com/mlb/player/stats/_/id/{{{espn}}}
|br= Baseball-Reference.com P1825 https://www.baseball-reference.com/players/{{{br}}}.shtml
|fangraphs= Fangraphs.com P3574 https://www.fangraphs.com/statss.aspx?playerid={{{fangraphs}}}
|cube= TheBaseballCube.com P4731 http://thebaseballcube.com/players/profile.asp?ID={{{cube}}}
|brm= Baseball-Reference.com (Minors) P1826 https://www.baseball-reference.com/minors/player.cgi?id={{{brm}}}
|retro= Retrosheet.org   https://www.retrosheet.org/boxesetc/{{retro}}.htm

Script error: No such module "If empty". This template does not currently use Wikidata properties.

cube

TheBaseballCube.com website has used three different URL and ID formats. The examples below all link to the same page for Cal Ripken; the first two redirect to the third:

  1. http://thebaseballcube.com/players/R/Cal-Ripken.shtml
  2. http://thebaseballcube.com/profile.asp?P=Cal-Ripken
  3. http://thebaseballcube.com/players/profile.asp?ID=550

This template has been updated to generate the correct URL for any of these three formats:

1. {{Baseballstats | cube = R/Cal-Ripken }}

  • Career statistics and player information from Error: Template:Baseballstats must contain at least one valid parameter name.

2. {{Baseballstats | cube = Cal-Ripken }}

  • Career statistics and player information from Error: Template:Baseballstats must contain at least one valid parameter name.

3. {{Baseballstats | cube = 550 }}

  • Career statistics and player information from Error: Template:Baseballstats must contain at least one valid parameter name.

The warning message may be removed by updating the |cube= parameter to use the ID number. As per the two associated tracking categories shown below, the conversion to numeric IDs in articles using this template is Division by zero.% complete (select Script error: No such module "Purge". to update).

Maintenance/tracking categories