Difference between revisions of "Template:EFA player/doc"

From blackwiki
Jump to navigation Jump to search
imported>John of Reading
m (→‎Instructions: Typo fixing, replaced: Assocation → Association using AWB)
imported>Zyxw
(update instructions and examples, add TemplateData, updates for use of Wikidata property P3659)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
+
<!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata -->
This is a template to generate links to [[Estonian Football Association]].
+
{{Uses Wikidata|P3659}}
 +
{{Lua|Module:EditAtWikidata}}
 +
 
 +
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to an [[association football]] ([[soccer]]) player's profile at the [[Estonian Football Association]] website ([http://www.jalgpall.ee/ jalgpall.ee]). It is intended for use in the [[Wikipedia:External links|external links]] section of an article.
 +
 
 +
== Usage ==
 +
Unnamed parameters:
 +
: {{tlcw|{{BASEPAGENAME}} | <var>ID</var> }}
 +
: {{tlcw|{{BASEPAGENAME}} | <var>ID</var> | <var>NAME</var> }}
 +
 
 +
Named parameters:
 +
: {{tlcw|{{BASEPAGENAME}} | id{{=}} <var>ID</var> }}
 +
: {{tlcw|{{BASEPAGENAME}} | id{{=}} <var>ID</var> | name{{=}} <var>NAME</var> }}
 +
 
 +
Using [[Wikidata]] property [[d:Property:P3659|P3659]]:
 +
: {{tlcw|{{BASEPAGENAME}}}}
 +
: {{tlcw|{{BASEPAGENAME}} | name{{=}} <var>NAME</var> }}
 +
 
 +
== Examples ==
 +
 
 +
=== Unnamed parameters ===
 +
''URL:''
 +
: <tt>[http://www.jalgpall.ee/players.php?player=2307&name=Tarmo%20Neemelo http://www.jalgpall.ee/players.php?player={{Hilite|2307}}&name=Tarmo%20Neemelo]</tt>
 +
 
 +
''Usage:''
 +
: {{tlcw|{{BASEPAGENAME}} | 2307 | Tarmo Neemelo }}
 +
 
 +
''Output:''
 +
: {{{{BASEPAGENAME}} | 2307 | Tarmo Neemelo }}
 +
 
 +
=== Named parameters ===
 +
''URL:''
 +
: <tt>[http://www.jalgpall.ee/players.php?player=115&name=Konstantin%20Nahk http://www.jalgpall.ee/players.php?player={{Hilite|115}}&name=Konstantin%20Nahk]</tt>
 +
 
 +
''Usage:''
 +
: {{tlcw|{{BASEPAGENAME}} | id{{=}} 115 | name{{=}} Konstantin Nahk }}
 +
 
 +
''Output:''
 +
: {{{{BASEPAGENAME}} | id= 115 | name= Konstantin Nahk }}
 +
 
 +
=== No parameters and Wikidata property not defined ===
 +
''Usage:''
 +
: {{tlcw|{{BASEPAGENAME}}}}
 +
 
 +
''Output:''
 +
: {{{{BASEPAGENAME}}<!-- -->}}
  
 
==Instructions==
 
==Instructions==
# Go to [http://www.jalgpall.ee/ Estonian Football Association] and search for the person you want
+
# Go to the [http://www.jalgpall.ee/ Estonian Football Association website] and enter the player's name in the search box.
# Click on the correct link to go to the person's page. Be sure you're getting the right person
+
# On the search results page, click the correct link for the person's page. Be sure you're getting the right person.
# The page [[URL]] should look like ''<nowiki>http://www.jalgpall.ee/players.php?player=2307&name=Tarmo%20Neemelo</nowiki>'' where "2307" indicates number
+
# The page [[Uniform resource locator|URL]] should look like <code><nowiki>http://</nowiki>www.jalgpall.ee/players.php?player=<var>####</var>&name=First%20Last</code>, where "<var>####</var>" is the ID number for the player.
# Copy these two numbers
+
# Add one of the following to the external links section of the player's Wikipedia article:
# Add to the external links section the text:
+
#: <code><nowiki>* {{EFA player</nowiki>|<var>id</var>}}</code>
::<nowiki>{{EFA player|id=####|name=Tarmo Neemelo}}</nowiki>
+
#: <code><nowiki>* {{EFA player</nowiki>|<var>id</var>|<var>name</var>}}</code>
::where "####" is the ''id''
+
#: where "<code><var>id</var></code>" is the player's ID number from the URL
 
+
#: and "<code><var>name</var></code>" is the player's name. If the name is not specified, the template will display the Wikipedia [[Wikipedia:Page name|article name]], without any disambiguation such as "(footballer)" or "(soccer)".
===Example===
 
#Searching for "Tarmo Neemelo", you'll reach this page: http://www.jalgpall.ee/players.php?year=2010&player=2307&team=11
 
#Copy "####", then write:  <nowiki>{{EFA player|id=2307|name=Tarmo Neemelo}}</nowiki>
 
The result is {{EFA player|id=2307|name=Tarmo Neemelo}}
 
  
Note that, since this will almost certainly go on the external link section, you should add a * before the template text to include it as a list item.
+
== TemplateData ==
 +
{{TemplateData header}}
 +
<templatedata>
 +
{
 +
  "description": "This template displays an external link to an association football (soccer) player's profile at the Estonian Football Association website (jalgpall.ee). It is intended for use in the external links section of an article.",
 +
  "params": {
 +
    "id": {
 +
      "label": "id",
 +
      "aliases": ["1"],  
 +
      "description": "The \"id\" parameter should contain the ID portion of player's URL. Examples: \"2307\" is the ID portion of http://www.jalgpall.ee/players.php?player=2307&name=. This parameter is optional if Wikidata property P3659 exists, but required if not.",
 +
      "type": "number",
 +
      "required": false,
 +
      "default": "Wikidata property P3659"
 +
    },
 +
    "name": {
 +
      "label": "name",
 +
      "aliases": ["2"],
 +
      "description": "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 \"(footballer)\" or \"(soccer)\".",
 +
      "type": "string",
 +
      "required": false,
 +
      "default": "{{PAGENAMEBASE}}"
 +
    }
 +
  },
 +
  "paramOrder": [
 +
    "id",
 +
    "name"
 +
  ]
 +
}
 +
</templatedata>
  
<includeonly>
+
<includeonly>{{sandbox other||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
+
<!-- Categories below this line; interwikis at Wikidata -->
 
[[Category:Association football external link templates]]
 
[[Category:Association football external link templates]]
 
[[Category:People and person external link templates]]
 
[[Category:People and person external link templates]]
</includeonly>
+
[[Category:External link templates using Wikidata]]
 +
}}</includeonly>

Revision as of 03:32, 30 March 2017

Template:Uses Wikidata

Template:EFA player displays an external link to an association football (soccer) player's profile at the Estonian Football Association website (jalgpall.ee). It is intended for use in the external links section of an article.

Usage

Unnamed parameters:

Template:Tlcw
Template:Tlcw

Named parameters:

Template:Tlcw
Template:Tlcw

Using Wikidata property P3659:

Template:Tlcw
Template:Tlcw

Examples

Unnamed parameters

URL:

http://www.jalgpall.ee/players.php?player=2307&name=Tarmo%20Neemelo

Usage:

Template:Tlcw

Output:

Tarmo Neemelo at the Estonian Football Association (in Estonian)Script error: No such module "EditAtWikidata".Template:WikidataCheck

Named parameters

URL:

http://www.jalgpall.ee/players.php?player=115&name=Konstantin%20Nahk

Usage:

Template:Tlcw

Output:

Konstantin Nahk at the Estonian Football Association (in Estonian)Script error: No such module "EditAtWikidata".Template:WikidataCheck

No parameters and Wikidata property not defined

Usage:

Template:Tlcw

Output:

Template:PAGENAMEBASE at the Estonian Football Association (in Estonian)Script error: No such module "EditAtWikidata".Template:WikidataCheck

Instructions

  1. Go to the Estonian Football Association website and enter the player's name in the search box.
  2. On the search results page, click the correct link for the person's page. Be sure you're getting the right person.
  3. The page URL should look like http://www.jalgpall.ee/players.php?player=####&name=First%20Last, where "####" is the ID number for the player.
  4. Add one of the following to the external links section of the player's Wikipedia article:
    * {{EFA player|id}}
    * {{EFA player|id|name}}
    where "id" is the player's ID number from the URL
    and "name" is the player's name. If the name is not specified, the template will display the Wikipedia article name, without any disambiguation such as "(footballer)" or "(soccer)".

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for EFA player

This template displays an external link to an association football (soccer) player's profile at the Estonian Football Association website (jalgpall.ee). It is intended for use in the external links section of an article.

Template parameters

ParameterDescriptionTypeStatus
idid 1

The "id" parameter should contain the ID portion of player's URL. Examples: "2307" is the ID portion of http://www.jalgpall.ee/players.php?player=2307&name=. This parameter is optional if Wikidata property P3659 exists, but required if not.

Default
Wikidata property P3659
Numberoptional
namename 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 "(footballer)" or "(soccer)".

Default
{{PAGENAMEBASE}}
Stringoptional