Difference between revisions of "Template:Baseballstats/doc"

From blackwiki
Jump to navigation Jump to search
imported>Bender235
m (→‎Parameters: ESPN now uses HTTPS, too.)
imported>Bagumba
 
Line 10: Line 10:
 
To use this template, copy and paste this text to a baseball player's external links section:
 
To use this template, copy and paste this text to a baseball player's external links section:
  
<pre>{{Baseballstats |mlb= |espn= |br= |fangraphs= |cube= |brm= |retro=}}</pre>
+
<pre>{{Baseballstats |mlb= |espn= |br= |fangraphs= |brm= |retro=}}</pre>
  
 
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.
 
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.
Line 17: Line 17:
 
Example for [[Chris Young (outfielder)]]:
 
Example for [[Chris Young (outfielder)]]:
  
<code><nowiki>{{Baseballstats |mlb= 455759 |espn= 6514 |br= y/youngch04 |fangraphs= 3882 |cube= 134 |brm= young-001chr |retro= Y/Pyounc004 }}</nowiki></code>
+
<code><nowiki>{{Baseballstats |mlb= 455759 |espn= 6514 |br= y/youngch04 |fangraphs= 3882 |brm= young-001chr |retro= Y/Pyounc004 }}</nowiki></code>
  
 
results in:
 
results in:
{{Baseballstats |mlb= 455759 |espn= 6514 |br= y/youngch04 |fangraphs= 3882 |cube= 134 |brm= young-001chr |retro= Y/Pyounc004 }}
+
{{Baseballstats |mlb= 455759 |espn= 6514 |br= y/youngch04 |fangraphs= 3882 |brm= young-001chr |retro= Y/Pyounc004 }}
  
 
To find a player's ID, find the player's page on a website and locate a string of numbers or letters in the [[Uniform Resource Locator|URL]] similar to the ones above. That is the player's ID.
 
To find a player's ID, find the player's page on a website and locate a string of numbers or letters in the [[Uniform Resource Locator|URL]] similar to the ones above. That is the player's ID.
Line 50: Line 50:
 
| [[d:Property:P3574|P3574]]
 
| [[d:Property:P3574|P3574]]
 
| <small><kbd><nowiki>https://www.fangraphs.com/statss.aspx?playerid={{{fangraphs}}}</nowiki></kbd></small>
 
| <small><kbd><nowiki>https://www.fangraphs.com/statss.aspx?playerid={{{fangraphs}}}</nowiki></kbd></small>
|-
 
| {{para|cube}}
 
| [http://thebaseballcube.com/ TheBaseballCube.com]
 
| [[d:Property:P4731|P4731]]
 
| <small><kbd><nowiki>http://thebaseballcube.com/players/profile.asp?ID={{{cube}}}</nowiki></kbd></small>
 
 
|-
 
|-
 
| {{para|brm}}
 
| {{para|brm}}
Line 67: Line 62:
 
|}
 
|}
 
{{dagger}} This template does not currently use Wikidata properties.
 
{{dagger}} 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:
 
 
# <kbd>[http://thebaseballcube.com/players/R/Cal-Ripken.shtml http://thebaseballcube.com/players/{{highlight|R/Cal-Ripken}}.shtml]</kbd>
 
# <kbd>[http://thebaseballcube.com/profile.asp?P=Cal-Ripken http://thebaseballcube.com/profile.asp?P={{highlight|Cal-Ripken}}]</kbd>
 
# <kbd>[http://thebaseballcube.com/players/profile.asp?ID=550 http://thebaseballcube.com/players/profile.asp?ID={{highlight|550}}]</kbd>
 
 
This template has been updated to generate the correct URL for any of these three formats:
 
 
1. <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | cube = R/Cal-Ripken }}</code>
 
{{{{BASEPAGENAME}} | cube = R/Cal-Ripken }}
 
2. <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | cube = Cal-Ripken }}</code>
 
{{{{BASEPAGENAME}} | cube = Cal-Ripken }}
 
3. <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | cube = 550 }}</code>
 
{{{{BASEPAGENAME}} | cube = 550 }}
 
 
The warning message may be removed by updating the {{para|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 {{#expr:{{formatnum:{{PAGESINCATEGORY:Pages using baseballstats with numeric value in cube parameter}}|R}}/({{formatnum:{{PAGESINCATEGORY:Pages using baseballstats with non-numeric value in cube parameter}}|R}}+{{formatnum:{{PAGESINCATEGORY:Pages using baseballstats with numeric value in cube parameter}}|R}})*100 round 1}}% complete (select {{Purge}} to update).
 
  
 
==Maintenance/tracking categories==
 
==Maintenance/tracking categories==
 
* {{clc|Pages using baseballstats with unknown parameters}}
 
* {{clc|Pages using baseballstats with unknown parameters}}
* {{clc|Pages using baseballstats with non-numeric value in cube parameter}}
 
* {{clc|Pages using baseballstats with numeric value in cube parameter}}
 
  
 
<includeonly>{{Sandbox other||
 
<includeonly>{{Sandbox other||

Latest revision as of 05:54, 14 January 2020

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= |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 |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 https://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}}}
|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.

Maintenance/tracking categories