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

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
m (fix placement of category to include template, not documentation (via JWB))
imported>Zyxw
(Update documentation, examples, and tracking category links. Add TemplateData)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
+
<!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 +
{{Lua|Module:EditAtWikidata|Module:WikidataCheck}}
 
{{Uses Wikidata|P3050}}
 
{{Uses Wikidata|P3050}}
 
{{Tracks Wikidata|P3050}}
 
{{Tracks Wikidata|P3050}}
 +
 +
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to an [[association football]] ([[soccer]]) player's profile at the [[Football Association of the Czech Republic]] website ([http://nv.fotbal.cz/ nv.fotbal.cz]). It is intended for use in the [[Wikipedia:External links|external links]] section of an article.
  
 
== Usage ==
 
== 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:P3050|P3050]]:
 +
: {{tlcw|{{BASEPAGENAME}}}}
 +
: {{tlcw|{{BASEPAGENAME}} | name{{=}} <var>NAME</var> }}
  
=== No parameters ===
+
== Examples ==
Use:
 
  
: <code><nowiki>{{CMFS player}}</nowiki></code>  
+
=== Unnamed parameters ===
 +
''URL:''
 +
: <tt>[http://nv.fotbal.cz/reprezentace/reprezentace-a/statistiky/viewstat3.asp?name=PekhartTomas http://nv.fotbal.cz/reprezentace/reprezentace-a/statistiky/viewstat3.asp?name={{hilite|PekhartTomas}}]</tt>
 +
''Usage:''
 +
: {{tlcw|{{BASEPAGENAME}} | PekhartTomas | Tomáš Pekhart }}
 +
''Output:''
 +
: {{{{BASEPAGENAME}} | PekhartTomas | Tomáš Pekhart }}
  
and the template will pull the ID from [[Wikidata]] (if present there) and extract the link text from the page name, minus any parenthetical disambiguation.
+
=== Named parameters ===
 +
''URL:''
 +
: <tt>[http://nv.fotbal.cz/reprezentace/reprezentace-a/statistiky/viewstat3.asp?name=CechPetr http://nv.fotbal.cz/reprezentace/reprezentace-a/statistiky/viewstat3.asp?name={{hilite|CechPetr}}]</tt>
 +
''Usage:''
 +
: {{tlcw|{{BASEPAGENAME}} | id{{=}} CechPetr | name{{=}} Petr Čech }}
 +
''Output:''
 +
: {{{{BASEPAGENAME}} | id= CechPetr | name= Petr Čech }}
  
=== With parameters ===
+
=== No parameters and Wikidata property not defined ===
<code><nowiki>{{CMFS player|id|name}}</nowiki></code>
+
''Usage:''
* eg: <code><nowiki>{{CMFS player|PekhartTomas|Tomáš Pekhart}}</nowiki></code>
+
: {{tlcw|{{BASEPAGENAME}}}}
* or <code><nowiki>{{CMFS player|PekhartTomas}}</nowiki></code>  
+
''Output:''
 +
: {{{{BASEPAGENAME}}<!-- -->}}
 +
 
 +
== TemplateData ==
 +
{{TemplateData header}}
 +
<templatedata>
 +
{
 +
  "description": "This template displays an external link to an association football (soccer) player's profile at the Football Association of the Czech Republic website (nv.fotbal.cz). It is intended for use in the external links section of an article.",
 +
  "params": {
 +
    "id": {
 +
      "label": "id",
 +
      "aliases": ["1"],
 +
      "description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the ID portion of the URL. Example: PekhartTomas is the ID portion of http://nv.fotbal.cz/reprezentace/reprezentace-a/statistiky/viewstat3.asp?name=PekhartTomas. This parameter is optional if Wikidata property P3050 exists, but required if not.",
 +
      "type": "string",
 +
      "default": "Wikidata property P3050",
 +
      "required": false
 +
    },
 +
    "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)\".",
 +
      "type": "string",
 +
      "default": "{{PAGENAMEBASE}}",
 +
      "required": false
 +
    }
 +
  },
 +
  "paramOrder": [
 +
    "id",
 +
    "name"
 +
  ]
 +
}
 +
</templatedata>
  
 
==Tracking categories==
 
==Tracking categories==
 +
; "id" parameter exists
 
* {{clc|CMFS player ID not in Wikidata}}
 
* {{clc|CMFS player ID not in Wikidata}}
 
* {{clc|CMFS player ID different from Wikidata}}
 
* {{clc|CMFS player ID different from Wikidata}}
 
* {{clc|CMFS player ID same as Wikidata}}
 
* {{clc|CMFS player ID same as Wikidata}}
* {{cl|CMFS player template with no id set}} (exists in template, not created)
+
; "id" parameter does not exist
 +
* {{clc|CMFS player template missing ID}}
  
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||
Line 28: Line 86:
 
[[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]]
 +
[[Category:External link templates using Wikidata]]
 
[[Category:Templates that add a tracking category]]
 
[[Category:Templates that add a tracking category]]
 
[[Category:External link templates using Wikidata]]
 
 
}}</includeonly>
 
}}</includeonly>

Revision as of 19:13, 18 March 2017

Template:Uses Wikidata Template:Tracks Wikidata

Template:FACR player displays an external link to an association football (soccer) player's profile at the Football Association of the Czech Republic website (nv.fotbal.cz). 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 P3050:

Template:Tlcw
Template:Tlcw

Examples

Unnamed parameters

URL:

http://nv.fotbal.cz/reprezentace/reprezentace-a/statistiky/viewstat3.asp?name=PekhartTomas

Usage:

Template:Tlcw

Output:

Tomáš Pekhart at FAČR (in Czech)Script error: No such module "EditAtWikidata".Template:WikidataCheck

Named parameters

URL:

http://nv.fotbal.cz/reprezentace/reprezentace-a/statistiky/viewstat3.asp?name=CechPetr

Usage:

Template:Tlcw

Output:

Petr Čech at FAČR (in Czech)Script error: No such module "EditAtWikidata".Template:WikidataCheck

No parameters and Wikidata property not defined

Usage:

Template:Tlcw

Output:

Template:PAGENAMEBASE at FAČR (in Czech)Script error: No such module "EditAtWikidata".Template:WikidataCheck

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 FACR player

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

Template parameters

ParameterDescriptionTypeStatus
idid 1

The "id" parameter (or unnamed parameter "1") should contain the ID portion of the URL. Example: PekhartTomas is the ID portion of http://nv.fotbal.cz/reprezentace/reprezentace-a/statistiky/viewstat3.asp?name=PekhartTomas. This parameter is optional if Wikidata property P3050 exists, but required if not.

Default
Wikidata property P3050
Stringoptional
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)".

Default
{{PAGENAMEBASE}}
Stringoptional

Tracking categories

"id" parameter exists
"id" parameter does not exist