Difference between revisions of "Template:IOC profile/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
(add alternative name, update template data, misc formatting)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
<!-- 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]]) -->
 +
{{Larger|{{Template shortcut|Olympic.org}}}}
 
{{Uses Wikidata|P3171}}
 
{{Uses Wikidata|P3171}}
 
{{Tracks Wikidata|P3171}}
 
{{Tracks Wikidata|P3171}}
Line 19: Line 20:
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
 
== TemplateData ==
 
{{TemplateDataHeader}}
 
<templatedata>
 
{
 
  "description": "This template displays an external link to an athlete's profile at Olympic.org, the official website of the International Olympic Committee (IOC). 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: michael-phelps is the ID portion of https://www.olympic.org/michael-phelps.  This parameter is optional if Wikidata property P3171 exists, but required if not.",
 
      "type": "string",
 
      "default": "Wikidata property P3171",
 
      "required": true
 
    },
 
    "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 athlete. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as \"(athlete)\".",
 
      "type": "string",
 
      "default": "{{PAGENAMEBASE}}",
 
      "required": false
 
    }
 
  }
 
}
 
</templatedata>
 
  
 
== Examples ==
 
== Examples ==
Line 69: Line 44:
 
''Output:''
 
''Output:''
 
: {{ {{BASEPAGENAME}} }}
 
: {{ {{BASEPAGENAME}} }}
 +
 +
== TemplateData ==
 +
{{TemplateData header}}
 +
<templatedata>
 +
{
 +
  "description": "This template displays an external link to an athlete's profile at Olympic.org, the official website of the International Olympic Committee (IOC). 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: michael-phelps is the ID portion of https://www.olympic.org/michael-phelps. This parameter is optional if Wikidata property P3171 exists, but required if not.",
 +
      "type": "string",
 +
      "required": true,
 +
      "default": "Wikidata property P3171"
 +
    },
 +
    "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 athlete. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as \"(athlete)\".",
 +
      "type": "string",
 +
      "required": false,
 +
      "default": "{{PAGENAMEBASE}}"
 +
    }
 +
  },
 +
  "paramOrder": [
 +
    "id",
 +
    "name"
 +
  ]
 +
}
 +
</templatedata>
  
 
== Tracking categories ==
 
== Tracking categories ==
Line 89: Line 94:
 
[[Category:Olympics external link templates]]
 
[[Category:Olympics 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 07:39, 25 April 2017

Template:Uses Wikidata Template:Tracks Wikidata

Template:IOC profile displays an external link to an athlete's profile at Olympic.org, the official website of the International Olympic Committee (IOC). It is intended for use in the external links section of an article.

Usage

Unnamed parameters:

{{IOC profile | ID }}
{{IOC profile | ID | NAME }}

Named parameters:

{{IOC profile | id= ID }}
{{IOC profile | id= ID | name= NAME }}

Using Wikidata property P3171:

{{IOC profile}}
{{IOC profile | name= NAME }}

Examples

Unnamed parameters

URL:

https://www.olympic.org/michael-phelps

Usage:

{{IOC profile | michael-phelps | Michael Phelps }}

Output:

Michael Phelps at the International Olympic CommitteeScript error: No such module "EditAtWikidata".Template:WikidataCheck

Named parameters

URL:

https://www.olympic.org/larisa-latynina

Usage:

{{IOC profile |id= larisa-latynina |name= Larisa Latynina }}

Output:

Larisa Latynina at the International Olympic CommitteeScript error: No such module "EditAtWikidata".Template:WikidataCheck

No parameters and Wikidata property not defined

Usage:

{{IOC profile}}

Output:

Template:PAGENAMEBASE at the International Olympic CommitteeScript 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 IOC profile

This template displays an external link to an athlete's profile at Olympic.org, the official website of the International Olympic Committee (IOC). 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: michael-phelps is the ID portion of https://www.olympic.org/michael-phelps. This parameter is optional if Wikidata property P3171 exists, but required if not.

Default
Wikidata property P3171
Stringrequired
namename 2

The "name" parameter (or unnamed parameter "2") may be used to specify the link text, which should be the name of the athlete. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation such as "(athlete)".

Default
{{PAGENAMEBASE}}
Stringoptional

Tracking categories

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

See also

External links