Difference between revisions of "Template:Iso2country/doc"
Jump to navigation
Jump to search
(→See also: +cat) |
imported>Vanisaac m (→See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other) |
||
| (26 intermediate revisions by 22 users not shown) | |||
| Line 2: | Line 2: | ||
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. --> | <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. --> | ||
==Usage== | ==Usage== | ||
| − | Given | + | Given an ISO country code ([[ISO 3166-1 alpha-2]]), this template returns the matching country. |
| − | It has | + | |
| + | It has two optional parameters: | ||
| + | * {{para|article}}, which if it set to {{code|yes}} will return the article "the" if needed; | ||
| + | * {{para|mode}}, which can optionally take one out of three values: | ||
| + | :* if set to {{code|sort}}, it will rearrange for sortkey. | ||
| + | :* if set to {{code|unique}}, it will return " (country)" if needed. | ||
| + | :* if set to {{code|link}}, it will create a link. | ||
| + | |||
| + | '''Basic usage''' | ||
{| class="wikitable" | {| class="wikitable" | ||
| − | ! | + | ! country code |
| − | ! | + | ! default |
| + | ! {{para|mode|<var>sort</var>}} | ||
| + | ! {{para|mode|<var>unique</var>}} | ||
| + | ! {{para|mode|<var>link</var>}} | ||
|- | |- | ||
| − | | | + | | {{tlx|iso2country|ES}} |
| {{iso2country|ES}} | | {{iso2country|ES}} | ||
| − | | | + | | {{iso2country|ES|mode=sort}} |
| − | | | + | | {{iso2country|ES|mode=unique}} |
| − | | {{iso2country| | + | | {{iso2country|ES|mode=link}} |
|- | |- | ||
| <code><nowiki>{{iso2country|US}}</nowiki></code> | | <code><nowiki>{{iso2country|US}}</nowiki></code> | ||
| {{iso2country|US}} | | {{iso2country|US}} | ||
| + | | {{iso2country|US|mode=sort}} | ||
| + | | {{iso2country|US|mode=unique}} | ||
| + | | {{iso2country|US|mode=link}} | ||
| + | |- | ||
| + | | <code><nowiki>{{iso2country|IE}}</nowiki></code> | ||
| + | | {{iso2country|IE}} | ||
| + | | {{iso2country|IE|mode=sort}} | ||
| + | | {{iso2country|IE|mode=unique}} | ||
| + | | {{iso2country|IE|mode=link}} | ||
| + | |- | ||
| + | | <code><nowiki>{{iso2country|CD}}</nowiki></code> | ||
| + | | {{iso2country|CD}} | ||
| + | | {{iso2country|CD|mode=sort}} | ||
| + | | {{iso2country|CD|mode=unique}} | ||
| + | | {{iso2country|CD|mode=link}} | ||
| + | |- | ||
| + | | <code><nowiki>{{iso2country|GE}}</nowiki></code> | ||
| + | | {{iso2country|GE}} | ||
| + | | {{iso2country|GE|mode=sort}} | ||
| + | | {{iso2country|GE|mode=unique}} | ||
| + | | {{iso2country|GE|mode=link}} | ||
| + | |} | ||
| + | |||
| + | '''Usage with {{para|article|<var>yes</var>}}''' | ||
| + | |||
| + | {| class="wikitable" | ||
| + | ! country code | ||
| + | ! default | ||
| + | ! {{para|mode|<var>sort</var>}} | ||
| + | ! {{para|mode|<var>unique</var>}} | ||
| + | ! {{para|mode|<var>link</var>}} | ||
|- | |- | ||
| − | | <code><nowiki>{{iso2country|US | + | | {{tlx|iso2country|ES}} |
| + | | {{iso2country|ES|article=yes}} | ||
| + | | {{iso2country|ES|mode=sort|article=yes}} | ||
| + | | {{iso2country|ES|mode=unique|article=yes}} | ||
| + | | {{iso2country|ES|mode=link|article=yes}} | ||
| + | |- | ||
| + | | <code><nowiki>{{iso2country|US}}</nowiki></code> | ||
| {{iso2country|US|article=yes}} | | {{iso2country|US|article=yes}} | ||
| + | | {{iso2country|US|mode=sort|article=yes}} | ||
| + | | {{iso2country|US|mode=unique|article=yes}} | ||
| + | | {{iso2country|US|mode=link|article=yes}} | ||
|- | |- | ||
| − | | <code><nowiki>{{iso2country| | + | | <code><nowiki>{{iso2country|IE}}</nowiki></code> |
| − | | {{iso2country| | + | | {{iso2country|IE|article=yes}} |
| + | | {{iso2country|IE|mode=sort|article=yes}} | ||
| + | | {{iso2country|IE|mode=unique|article=yes}} | ||
| + | | {{iso2country|IE|mode=link|article=yes}} | ||
| + | |- | ||
| + | | <code><nowiki>{{iso2country|CD}}</nowiki></code> | ||
| + | | {{iso2country|CD|article=yes}} | ||
| + | | {{iso2country|CD|mode=sort|article=yes}} | ||
| + | | {{iso2country|CD|mode=unique|article=yes}} | ||
| + | | {{iso2country|CD|mode=link|article=yes}} | ||
| + | |- | ||
| + | | <code><nowiki>{{iso2country|GE}}</nowiki></code> | ||
| + | | {{iso2country|GE|article=yes}} | ||
| + | | {{iso2country|GE|mode=sort|article=yes}} | ||
| + | | {{iso2country|GE|mode=unique|article=yes}} | ||
| + | | {{iso2country|GE|mode=link|article=yes}} | ||
|} | |} | ||
| + | |||
| + | '''Deprecated parameter''' | ||
| + | |||
| + | The misnamed {{para|template|''yes''}} parameter has been superseded by {{para|mode|''unique''}}. Continued use is tracked in {{cat|Pages using iso2country with unknown parameters}}. | ||
==See also== | ==See also== | ||
| − | *{{tl| | + | *{{tl|ISO 639 name}} |
| + | *{{tl|iso2nationality}} | ||
| − | <includeonly><!-- | + | <includeonly>{{Sandbox other||<!-- |
++++ PLEASE ADD CATEGORIES AND INTERWIKIS BELOW THIS LINE, INSIDE INCLUDEONLY TAGS, THANK YOU. --> | ++++ PLEASE ADD CATEGORIES AND INTERWIKIS BELOW THIS LINE, INSIDE INCLUDEONLY TAGS, THANK YOU. --> | ||
| − | [[Category:Wikipedia formatting templates|{{PAGENAME}}]] | + | [[Category:Wikipedia formatting and function templates|{{PAGENAME}}]] |
| − | </includeonly> | + | [[Category:Data templates| Iso2country]] |
| + | }}</includeonly> | ||
Latest revision as of 22:36, 25 April 2020
| This is a documentation subpage for Template:Iso2country. It contains usage information, categories and other content that is not part of the original template page. |
Usage
Given an ISO country code (ISO 3166-1 alpha-2), this template returns the matching country.
It has two optional parameters:
|article=, which if it set toyeswill return the article "the" if needed;|mode=, which can optionally take one out of three values:
- if set to
sort, it will rearrange for sortkey. - if set to
unique, it will return " (country)" if needed. - if set to
link, it will create a link.
- if set to
Basic usage
| country code | default | |mode=sort
|
|mode=unique
|
|mode=link
|
|---|---|---|---|---|
{{iso2country|ES}}
|
Spain | Spain | Spain | Spain |
{{iso2country|US}}
|
United States | United States | United States | United States |
{{iso2country|IE}}
|
Republic of Ireland | Ireland | Republic of Ireland | Republic of Ireland |
{{iso2country|CD}}
|
Democratic Republic of the Congo | Congo, D | Democratic Republic of the Congo | Democratic Republic of the Congo |
{{iso2country|GE}}
|
Georgia | Georgia | Georgia (country) | Georgia |
Usage with |article=yes
| country code | default | |mode=sort
|
|mode=unique
|
|mode=link
|
|---|---|---|---|---|
{{iso2country|ES}}
|
Spain | Spain | Spain | Spain |
{{iso2country|US}}
|
the United States | United States | the United States | the United States |
{{iso2country|IE}}
|
the Republic of Ireland | Ireland | the Republic of Ireland | the Republic of Ireland |
{{iso2country|CD}}
|
the Democratic Republic of the Congo | Congo, D | the Democratic Republic of the Congo | the Democratic Republic of the Congo |
{{iso2country|GE}}
|
Georgia | Georgia | Georgia (country) | Georgia |
Deprecated parameter
The misnamed |template=yes parameter has been superseded by |mode=unique. Continued use is tracked in Category:Pages using iso2country with unknown parameters.
See also
- {{ISO 639 name}}
- {{iso2nationality}}