Difference between revisions of "Template:ESPN NFL"
imported>Zyxw (update URL, use Wikidata property if no "id", add documentation) |
imported>Zyxw (If Wikidata property has multiple values, only use first one. Remove {{Trim|}} since {{#if:}} does same. Add {{EditAtWikidata}} link, similar to most other external link templates using Wikidata.) |
||
| Line 1: | Line 1: | ||
{{#if: {{{1<includeonly>|</includeonly>}}} {{{id|}}} {{#property:P3686}} | {{#if: {{{1<includeonly>|</includeonly>}}} {{{id|}}} {{#property:P3686}} | ||
| − | |[http://www.espn.com/nfl/player/stats/_/id/{{ | + | |
| − | |<span class="error">{{[[Template:ESPN NFL|ESPN NFL]]}} template missing ID and not present in Wikidata.</span> | + | | [http://www.espn.com/nfl/player/stats/_/id/{{#if: {{{1|{{{id<includeonly>|</includeonly>}}}}}} | {{{1|{{{id}}}}}} | {{First word|1={{#property:P3686}}|sep=,}} }} {{#if: {{{2|{{{name<includeonly>|</includeonly>}}}}}} | {{{2|{{{name}}}}}} | {{PAGENAMEBASE}} }}] at [[ESPN|ESPN.com]]<includeonly>{{EditAtWikidata|pid=P3686|{{{1|{{{id|}}}}}}}}</includeonly> |
| + | |||
| + | | <span class="error">{{[[Template:ESPN NFL|ESPN NFL]]}} template missing ID and not present in Wikidata.</span> | ||
| + | |||
}}<noinclude> | }}<noinclude> | ||
{{Documentation}}<!-- Please add categories to the /doc subpage & add interwikis to Wikidata. --> | {{Documentation}}<!-- Please add categories to the /doc subpage & add interwikis to Wikidata. --> | ||
</noinclude> | </noinclude> | ||
Revision as of 11:56, 12 October 2018
Template:Uses Wikidata Lua error in Module:Lua_banner at line 113: attempt to index field 'edit' (a nil value).
Template:ESPN NFL displays an external link to a National Football League (NFL) player's profile at ESPN.com. It is intended for use in the external links section of an article.
Contents
Usage
Unnamed parameters:
{{ESPN NFL | ID }}{{ESPN NFL | ID | NAME }}
Named parameters:
{{ESPN NFL | id= ID }}{{ESPN NFL | id= ID | name= NAME }}
Using Wikidata property Template:Property:
{{ESPN NFL}}{{ESPN NFL | name= NAME }}
Examples
Unnamed parameters
Usage:
* {{ESPN NFL | 10536 | Trent Edwards }}
Output:
- Trent Edwards at ESPN.comScript error: No such module "EditAtWikidata".
Current URLs:
- https://www.espn.com/nfl/player/stats/_/id/10536
- https://www.espn.com/nfl/player/stats/_/id/10536/trent-edwards
Former URLs:
- http://espn.go.com/nfl/player/stats/_/id/10536
- http://espn.go.com/nfl/player/stats/_/id/10536/trent-edwards
Named parameters
Usage:
* {{ESPN NFL | id= 15994 | name= Theo Riddick }}
Output:
- Theo Riddick at ESPN.comScript error: No such module "EditAtWikidata".
Current URLs:
- https://www.espn.com/nfl/player/stats/_/id/15994
- https://www.espn.com/nfl/player/stats/_/id/15994/theo-riddick
Former URLs:
- http://espn.go.com/nfl/player/stats/_/id/15994
- http://espn.go.com/nfl/player/stats/_/id/15994/theo-riddick
No parameters and Wikidata property not defined
Usage:
* {{ESPN NFL}}
Output:
- Template:PAGENAMEBASE at ESPN.comScript error: No such module "EditAtWikidata".
TemplateData
TemplateData for ESPN NFL
This template displays an external link to a National Football League (NFL) player's profile at ESPN.com. It is intended for use in the external links section of an article.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Player ID | id 1 | The "id" parameter (or unnamed parameter "1") should contain the ID portion of the URL for the player's profile. Example: 15994 is the ID portion of https://www.espn.com/nfl/player/stats/_/id/15994. This parameter is optional if Wikidata property P3686 exists, but required if not.
| Number | required |
| Player name | name 2 | The "name" parameter (or unnamed parameter "2") may be used to specify the link text, which should be the name of the player. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as "(football player)".
| String | optional |
See also
- {{Footballstats}}
Other ESPN external link templates:
- {{ESPN FC}}
- {{ESPN MMA}}
- {{ESPN NHL}}
- {{ESPNcricinfo}}
- {{ESPNscrum}}
| The above documentation is transcluded from Template:ESPN NFL/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |