Difference between revisions of "Template:IOC profile/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
imported>Zyxw
(update usage and examples)
Line 12: Line 12:
 
== Usage ==
 
== Usage ==
 
Unnamed parameters:
 
Unnamed parameters:
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
+
: {{tlcw|{{BASEPAGENAME}} | <var>ID</var> }}
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''NAME'' }}</code>
+
: {{tlcw|{{BASEPAGENAME}} | <var>ID</var> | <var>NAME</var> }}
  
 
Named parameters:
 
Named parameters:
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' }}</code>
+
: {{tlcw|{{BASEPAGENAME}} | id{{=}} <var>ID</var> }}
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''ID'' | name= ''NAME'' }}</code>
+
: {{tlcw|{{BASEPAGENAME}} | id{{=}} <var>ID</var> | name{{=}} <var>NAME</var> }}
  
 
Using [[Wikidata]] property [[d:Property:P3171|P3171]]:
 
Using [[Wikidata]] property [[d:Property:P3171|P3171]]:
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
+
: {{tlcw|{{BASEPAGENAME}} }}
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''NAME'' }}</code>
+
: {{tlcw|{{BASEPAGENAME}} | name{{=}} <var>NAME</var> }}
  
 
== Examples ==
 
== Examples ==
  
=== Unnamed parameters ===
+
=== ID in template ===
 +
''Usage in the article [[Michael Phelps]]''
 +
: {{tlcw|a=1|{{BASEPAGENAME}} | michael-phelps }}
 +
: {{tlcw|a=1|{{BASEPAGENAME}} | id{{=}} michael-phelps }}
 +
 
 +
''Usage with name parameter in template''
 +
: {{tlcw|a=1|{{BASEPAGENAME}} | michael-phelps | Michael Phelps }}
 +
: {{tlcw|a=1|{{BASEPAGENAME}} | id{{=}} michael-phelps | name{{=}} Michael Phelps }}
 +
 
 +
''Output:''
 +
:* {{{{BASEPAGENAME}} | michael-phelps | Michael Phelps }}
 +
 
 
''URL:''
 
''URL:''
: <tt>[https://www.olympic.org/michael-phelps https://www.olympic.org/{{hilite|michael-phelps}}]</tt>
+
: <kbd>[https://www.olympic.org/michael-phelps https://www.olympic.org/{{hilite|michael-phelps}}]</kbd>
''Usage:''
+
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | michael-phelps | Michael Phelps }}</code>
+
=== ID in Wikidata ===
''Output:''
+
''Usage in the article [[Larisa Latynina]], with article name as link text''
: {{{{BASEPAGENAME}} | michael-phelps | Michael Phelps }}
+
: {{tlcw|a=1|{{BASEPAGENAME}} }}
 +
 
 +
''Usage in the article [[Larisa Latynina]], with name parameter as link text''
 +
: {{tlcw|a=1|{{BASEPAGENAME}} | name{{=}} Larisa Latynina }}
 +
 
 +
''Output''
 +
:* {{{{BASEPAGENAME}} | larisa-latynina | Larisa Latynina }} [[File:Blue pencil.svg |frameless |text-top |10px |alt=Edit this at Wikidata |link=https://www.wikidata.org/wiki/Q22102#P3171 |Edit this at Wikidata]]
  
=== Named parameters ===
 
 
''URL:''
 
''URL:''
: <tt>[https://www.olympic.org/larisa-latynina https://www.olympic.org/{{hilite|larisa-latynina}}]</tt>
+
: <kbd>[https://www.olympic.org/larisa-latynina https://www.olympic.org/{{hilite|larisa-latynina}}]</kbd>
 +
 
 +
=== No ID in template or Wikidata ===
 
''Usage:''
 
''Usage:''
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} |id= larisa-latynina |name= Larisa Latynina }}</code>
+
: {{tlcw|a=1|{{BASEPAGENAME}} }}
''Output:''
 
: {{{{BASEPAGENAME}} |id= larisa-latynina |name= Larisa Latynina }}
 
  
=== No parameters and Wikidata property not defined ===
 
''Usage:''
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 
 
''Output:''
 
''Output:''
: {{ {{BASEPAGENAME}} }}
+
:* {{{{BASEPAGENAME}} }}
  
 
== TemplateData ==
 
== TemplateData ==

Revision as of 08:40, 28 May 2018

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:

Template:Tlcw
Template:Tlcw

Named parameters:

Template:Tlcw
Template:Tlcw

Using Wikidata property P3171:

Template:Tlcw
Template:Tlcw

Examples

ID in template

Usage in the article Michael Phelps

Template:Tlcw
Template:Tlcw

Usage with name parameter in template

Template:Tlcw
Template:Tlcw

Output:

URL:

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

ID in Wikidata

Usage in the article Larisa Latynina, with article name as link text

Template:Tlcw

Usage in the article Larisa Latynina, with name parameter as link text

Template:Tlcw

Output

URL:

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

No ID in template or Wikidata

Usage:

Template:Tlcw

Output:

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