Template:Country showdata: Difference between revisions
meta>Retireduser1111 m Edit + Cleaning up |
meta>Andrwsc |
||
Line 11: | Line 11: | ||
[[Image:{{{flag alias|Sin bandera.svg}}}|thumb|{{#ifexist: {{{alt attribute}}} | See also: [[{{{alt attribute}}}]] |{{#ifexist: Flag of {{{alias}}} | See also: [[Flag of {{{alias}}}]] | }} }}]] | [[Image:{{{flag alias|Sin bandera.svg}}}|thumb|{{#ifexist: {{{alt attribute}}} | See also: [[{{{alt attribute}}}]] |{{#ifexist: Flag of {{{alias}}} | See also: [[Flag of {{{alias}}}]] | }} }}]] | ||
== Standard parameters == | ==Standard parameters== | ||
{| class="wikitable" | {| class="wikitable" | ||
! Parameter name !! Value !! Meaning | ! Parameter name !! Value !! Meaning | ||
Line 22: | Line 22: | ||
<td><tt>shortname alias</tt></td> | <td><tt>shortname alias</tt></td> | ||
<td><tt>{{{shortname alias}}}</tt></td> | <td><tt>{{{shortname alias}}}</tt></td> | ||
<td>''(optional) '' Display name to be used for the wikilink, if <tt>alias</tt> is a disambiguated article name, for example</td> | <td>''(optional)'' Display name to be used for the wikilink, if <tt>alias</tt> is a disambiguated article name, for example</td> | ||
</tr> | </tr> | ||
}} | }} | ||
Line 33: | Line 33: | ||
<td><tt>alt attribute</tt></td> | <td><tt>alt attribute</tt></td> | ||
<td><tt>{{{alt attribute}}}</tt></td> | <td><tt>{{{alt attribute}}}</tt></td> | ||
<td>''(optional) '' [[alt attribute]] for flag image</td> | <td>''(optional)'' [[alt attribute]] for flag image</td> | ||
</tr> | </tr> | ||
}} | }} | ||
|} | |} | ||
{{#if: {{{var1|{{{flag alias-naval|}}}}}} | | {{#if: {{{var1|{{{flag alias-naval|}}}}}} | | ||
== Flag variants == | ==Flag variants== | ||
{{#ifexist: {{{alt attribute}}} | {{details|{{{alt attribute}}}}} | {{#ifexist: Flag of {{{alias}}} | {{details|Flag of {{{alias}}}}} | }} }} | {{#ifexist: {{{alt attribute}}} | {{details|{{{alt attribute}}}}} | {{#ifexist: Flag of {{{alias}}} | {{details|Flag of {{{alias}}}}} | }} }} | ||
<table class="wikitable"> | <table class="wikitable"> | ||
<tr><th>Label</th><th>Flag image (40px) </th><th>Image name</th></tr> | <tr><th>Label</th><th>Flag image (40px)</th><th>Image name</th></tr> | ||
{{#if: {{{var1|}}} | <tr><td><tt>{{{var1}}}</tt></td><td align=center>[[Image:{{{flag alias-{{{var1}}}}}}|40px|border]]</td><td><tt>{{{flag alias-{{{var1}}}}}}</tt></td></tr> }}<!-- | {{#if: {{{var1|}}} | <tr><td><tt>{{{var1}}}</tt></td><td align=center>[[Image:{{{flag alias-{{{var1}}}}}}|40px|border]]</td><td><tt>{{{flag alias-{{{var1}}}}}}</tt></td></tr> }}<!-- | ||
-->{{#if: {{{var2|}}} | <tr><td><tt>{{{var2}}}</tt></td><td align=center>[[Image:{{{flag alias-{{{var2}}}}}}|40px|border]]</td><td><tt>{{{flag alias-{{{var2}}}}}}</tt></td></tr> }}<!-- | -->{{#if: {{{var2|}}} | <tr><td><tt>{{{var2}}}</tt></td><td align=center>[[Image:{{{flag alias-{{{var2}}}}}}|40px|border]]</td><td><tt>{{{flag alias-{{{var2}}}}}}</tt></td></tr> }}<!-- | ||
Line 56: | Line 56: | ||
}} | }} | ||
{{#if: {{{flag alias-naval|}}} | | {{#if: {{{flag alias-naval|}}} | | ||
== Naval ensign == | ==Naval ensign== | ||
This template includes a [[Maritime flag|naval ensign]] flag variant that can be used with [[Template:Navy]]: | This template includes a [[Maritime flag|naval ensign]] flag variant that can be used with [[Template:Navy]]: | ||
* <tt><nowiki>{{navy|</nowiki>{{{templatename|{{{alias}}}}}}<nowiki>}}</nowiki></tt> → {{navy|{{{templatename|{{{alias}}}}}}}} | * <tt><nowiki>{{navy|</nowiki>{{{templatename|{{{alias}}}}}}<nowiki>}}</nowiki></tt> → {{navy|{{{templatename|{{{alias}}}}}}}} | ||
Line 62: | Line 62: | ||
}} | }} | ||
{{#if: {{{flag alias-air force|}}} | | {{#if: {{{flag alias-air force|}}} | | ||
== Air force ensign == | ==Air force ensign== | ||
This template includes an air force ensign flag variant that can be used with [[Template:Air force]]: | This template includes an air force ensign flag variant that can be used with [[Template:Air force]]: | ||
* <tt><nowiki>{{air force|</nowiki>{{{templatename|{{{alias}}}}}}<nowiki>}}</nowiki></tt> → {{air force|{{{templatename|{{{alias}}}}}}}} | * <tt><nowiki>{{air force|</nowiki>{{{templatename|{{{alias}}}}}}<nowiki>}}</nowiki></tt> → {{air force|{{{templatename|{{{alias}}}}}}}} | ||
Line 68: | Line 68: | ||
}} | }} | ||
{{#if: {{{redir1|}}} | | {{#if: {{{redir1|}}} | | ||
== Redirect aliases == | ==Redirect aliases== | ||
This template can also be used via an ''alias'' name (implemented as a redirect to this template) :<!-- | This template can also be used via an ''alias'' name (implemented as a redirect to this template):<!-- | ||
--><table class="wikitable"><!-- | --><table class="wikitable"><!-- | ||
--><tr><th>Alias name</th><th>{{tlx|flag|''alias''}} output</th><th>{{tlx|flagcountry|''alias''}} output</th></tr> | --><tr><th>Alias name</th><th>{{tlx|flag|''alias''}} output</th><th>{{tlx|flagcountry|''alias''}} output</th></tr> | ||
{{#if: {{{redir1|}}} | <tr><td><tt>{{{redir1}}} (</tt><span class="plainlinks">[{{fullurl:Template:Country data {{{redir1}}}|redirect=no}} view]</span><tt>) </tt></td><td>{{flag|{{{redir1}}}}}</td><td>{{flagcountry|{{{redir1}}}}}</td></tr> }}<!-- | {{#if: {{{redir1|}}} | <tr><td><tt>{{{redir1}}} (</tt><span class="plainlinks">[{{fullurl:Template:Country data {{{redir1}}}|redirect=no}} view]</span><tt>)</tt></td><td>{{flag|{{{redir1}}}}}</td><td>{{flagcountry|{{{redir1}}}}}</td></tr> }}<!-- | ||
-->{{#if: {{{redir2|}}} | <tr><td><tt>{{{redir2}}} (</tt><span class="plainlinks">[{{fullurl:Template:Country data {{{redir2}}}|redirect=no}} view]</span><tt>) </tt></td><td>{{flag|{{{redir2}}}}}</td><td>{{flagcountry|{{{redir2}}}}}</td></tr> }}<!-- | -->{{#if: {{{redir2|}}} | <tr><td><tt>{{{redir2}}} (</tt><span class="plainlinks">[{{fullurl:Template:Country data {{{redir2}}}|redirect=no}} view]</span><tt>)</tt></td><td>{{flag|{{{redir2}}}}}</td><td>{{flagcountry|{{{redir2}}}}}</td></tr> }}<!-- | ||
-->{{#if: {{{redir3|}}} | <tr><td><tt>{{{redir3}}} (</tt><span class="plainlinks">[{{fullurl:Template:Country data {{{redir3}}}|redirect=no}} view]</span><tt>) </tt></td><td>{{flag|{{{redir3}}}}}</td><td>{{flagcountry|{{{redir3}}}}}</td></tr> }}<!-- | -->{{#if: {{{redir3|}}} | <tr><td><tt>{{{redir3}}} (</tt><span class="plainlinks">[{{fullurl:Template:Country data {{{redir3}}}|redirect=no}} view]</span><tt>)</tt></td><td>{{flag|{{{redir3}}}}}</td><td>{{flagcountry|{{{redir3}}}}}</td></tr> }}<!-- | ||
-->{{#if: {{{redir4|}}} | <tr><td><tt>{{{redir4}}} (</tt><span class="plainlinks">[{{fullurl:Template:Country data {{{redir4}}}|redirect=no}} view]</span><tt>) </tt></td><td>{{flag|{{{redir4}}}}}</td><td>{{flagcountry|{{{redir4}}}}}</td></tr> }}<!-- | -->{{#if: {{{redir4|}}} | <tr><td><tt>{{{redir4}}} (</tt><span class="plainlinks">[{{fullurl:Template:Country data {{{redir4}}}|redirect=no}} view]</span><tt>)</tt></td><td>{{flag|{{{redir4}}}}}</td><td>{{flagcountry|{{{redir4}}}}}</td></tr> }}<!-- | ||
-->{{#if: {{{redir5|}}} | <tr><td><tt>{{{redir5}}} (</tt><span class="plainlinks">[{{fullurl:Template:Country data {{{redir5}}}|redirect=no}} view]</span><tt>) </tt></td><td>{{flag|{{{redir5}}}}}</td><td>{{flagcountry|{{{redir5}}}}}</td></tr> }}<!-- | -->{{#if: {{{redir5|}}} | <tr><td><tt>{{{redir5}}} (</tt><span class="plainlinks">[{{fullurl:Template:Country data {{{redir5}}}|redirect=no}} view]</span><tt>)</tt></td><td>{{flag|{{{redir5}}}}}</td><td>{{flagcountry|{{{redir5}}}}}</td></tr> }}<!-- | ||
--></table> | --></table> | ||
}} | }} | ||
== Example usage == | ==Example usage== | ||
* <tt><nowiki>{{flag|</nowiki>{{{templatename|{{{alias}}}}}}<nowiki>}}</nowiki></tt> → {{flag|{{{templatename|{{{alias}}}}}}}} | * <tt><nowiki>{{flag|</nowiki>{{{templatename|{{{alias}}}}}}<nowiki>}}</nowiki></tt> → {{flag|{{{templatename|{{{alias}}}}}}}} | ||
* <tt><nowiki>{{flagicon|</nowiki>{{{templatename|{{{alias}}}}}}<nowiki>}}</nowiki></tt> → {{flagicon|{{{templatename|{{{alias}}}}}}}}<!-- | * <tt><nowiki>{{flagicon|</nowiki>{{{templatename|{{{alias}}}}}}<nowiki>}}</nowiki></tt> → {{flagicon|{{{templatename|{{{alias}}}}}}}}<!-- | ||
Line 96: | Line 96: | ||
}} | }} | ||
{{#if: {{{related1|}}} | | {{#if: {{{related1|}}} | | ||
== Related templates == | ==Related templates== | ||
Please see the following related <tt>country_data</tt> templates: | Please see the following related <tt>country_data</tt> templates: | ||
* [[Template:Country data {{{related1}}}]]<span style="position:absolute; left:32em;">{{flag|{{{related1}}}}}</span><!-- | *[[Template:Country data {{{related1}}}]]<span style="position:absolute; left:32em;">{{flag|{{{related1}}}}}</span><!-- | ||
-->{{#if: {{{related2|}}} | | -->{{#if: {{{related2|}}} | | ||
* [[Template:Country data {{{related2}}}]]<span style="position:absolute; left:32em;">{{flag|{{{related2}}}}}</span> }}<!-- | *[[Template:Country data {{{related2}}}]]<span style="position:absolute; left:32em;">{{flag|{{{related2}}}}}</span> }}<!-- | ||
-->{{#if: {{{related3|}}} | | -->{{#if: {{{related3|}}} | | ||
* [[Template:Country data {{{related3}}}]]<span style="position:absolute; left:32em;">{{flag|{{{related3}}}}}</span> }}<!-- | *[[Template:Country data {{{related3}}}]]<span style="position:absolute; left:32em;">{{flag|{{{related3}}}}}</span> }}<!-- | ||
-->{{#if: {{{related4|}}} | | -->{{#if: {{{related4|}}} | | ||
* [[Template:Country data {{{related4}}}]]<span style="position:absolute; left:32em;">{{flag|{{{related4}}}}}</span> }}<!-- | *[[Template:Country data {{{related4}}}]]<span style="position:absolute; left:32em;">{{flag|{{{related4}}}}}</span> }}<!-- | ||
-->{{#if: {{{related5|}}} | | -->{{#if: {{{related5|}}} | | ||
* [[Template:Country data {{{related5}}}]]<span style="position:absolute; left:32em;">{{flag|{{{related5}}}}}</span> }}<!-- | *[[Template:Country data {{{related5}}}]]<span style="position:absolute; left:32em;">{{flag|{{{related5}}}}}</span> }}<!-- | ||
-->}} | -->}} | ||
{{#ifexist: Template:{{PAGENAME}}/doc | | {{#ifexist: Template:{{PAGENAME}}/doc | | ||
== Other information == | ==Other information== | ||
{{/doc}} | {{/doc}} | ||
}} | }} |
Revision as of 16:55, 15 February 2008
This template is used on approximately 5,300 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
This template uses Lua: |
This template is used for documenting country data meta-templates used by the flag template system. The output of this template can be seen by directly viewing any of the country data templates.
See WikiProject Flag Template on English Wikipedia for the main documentation and discussion page for the flag template system.
Usage
This template is automatically invoked by the standard syntax of a country data template:
{{ {{{1<noinclude>|country showdata</noinclude>}}} | alias = Countryname | shortname alias = Shortcountryname <!-- Omitted unless Shortcountryname ≠ Countryname. --> | flag alias = Flag of Countryname.svg | size = {{{size|}}} | name = {{{name|}}} | variant = {{{variant|}}} <!-- Omitted unless flag alias-variant parameter(s) are present. --> }}
The first parameter to a country data template is usually the name of a formatting meta-template. For example, {{Flag}}
uses {{Flag/core}}
to actually render the flag icon and wikilink. If the first parameter is missing, which is the case when a country data template is viewed directly, the template code fragment {{{1<noinclude>|country showdata</noinclude>}}}
ensures that this template will be used as the default first parameter. This technique ensures that country data templates are "self-documenting" if they use the standard syntax.
Additional parameters
Many country data templates require additional documentation beyond the standard mandatory alias
and flag alias
parameters. This template will automatically document standard optional parameters (such as shortname alias
) if present—the documentation is in the template code—and can document unique optional parameters (such as flag variants) if instructed to. This latter method uses documentation-specific parameters in the country data template to activate the additional output from this template. These documentation parameters are set off from the rest of the parameters in the country data template by a <noinclude>
section:
<noinclude> | var1 = … | redir1 = … | related1 = … </noinclude>
Hatnote
If a brief hatnote is needed, then it can be added to the top of the documentation page by including the |hatnote=
parameter with any of the existing hatnote templates. For example:
|hatnote={{Hatnote|This template contains data that applies to the [[Republic of Ireland|sovereign state]]. For the island of [[Ireland]], see {{Tl|Country data Ireland}}.}}
…which results in…
{{Country data Ireland}}
.See also {{Country data Georgia (country)}}
for another hatnote example.
Flag variants
Flag variants are added to a country data template by the inclusion of one or more flag alias-label
parameters, where each label
is a unique identifier that is subsequently used as an input parameter to {{Flag|…}}
, {{Flag icon|…}}
, etc. To document these flag variants, use the varN
documentation parameters to identify each label.
For example, {{Country data Seychelles}}
identifies three flag variants (in addition to the current flag) with the following code:
| flag alias-1976 = Flag of the Seychelles 1976.svg | flag alias-1977 = Flag of the Seychelles 1977.svg | flag alias-colonial = Government Ensign of the United Kingdom.svg
These three variants are documented by the following code segment later in the template:
<noinclude> | var1 = 1976 | var2 = 1977 | var3 = colonial … </noinclude>
Up to forty flag variants can be documented by this method (using var1
to var40
). If more are present, these can be listed on a separate documentation subpage as described below.
Note that you do not have to use a varN
parameter for the standard optional variant labels naval
, air force
and army
(used for the country's naval, air force and army ensigns, respectively). If present, they will automatically be documented.
Redirect aliases
Many country data templates have alias names that can be used instead of the usual country name with all of the main flag templates. These are usually, but not exclusively, standard country code abbreviations such as those specified in ISO 3166-1 alpha-3 or by the IOC or FIFA.
For example, {{Country data DEU}}
and {{Country data GER}}
both redirect to {{Country data Germany}}
, because DEU is the ISO code and GER is the IOC and FIFA code for Germany. Therefore, {{Flag icon|DEU}}
, {{Flag icon|GER}}
, and {{Flag icon|Germany}}
all have the same result. These redirect aliases are documented by the following template code fragment:
<noinclude> … | redir1 = DEU | redir2 = GER … </noinclude>
Up to five flag redirects can be documented by this method (using redir1
to redir5
).
Related templates
Several country data templates are used for alternative forms to the common country data template for the nation, usually but not exclusively for historic nations. Pointers to these alternative templates are useful additions to the template documentation so that editors can use the correct template for their specific purposes.
For example, {{Country data Serbia and Montenegro}}
includes the following code to document three other related country data templates:
<noinclude> … | related1 = Serbia | related2 = Montenegro | related3 = FR Yugoslavia … </noinclude>
Up to six related flags can be documented by this method (using related1
to related6
).
Flag article link
This template shows a large flag image on the right of the documentation box, with a link to an article about the flag in the caption if it exists. The page that it evaluates is "Flag of {{{alias}}}
", with the value of |alias=
in the template code replacing {{{alias}}}
. If there is an article about the flag even though "Flag of {{{alias}}}
" does not exist, either create the latter as a redirect to the correct page or add the following parameter:
<noinclude> … | flag link = ''Article name'' … </noinclude>
This can also be used to override the automatic link if "Flag of {{{alias}}}
" does exist but leads to the wrong article.
Additional documentation
<noinclude>...</noinclude>
template {{Documentation}}
in the main country data template.For situations where the automatic documentation method is not completely adequate, additional documentation can be displayed by country showdata
. Simply create a documentation subpage (named as Template:Country data Countryname/doc) with the additional material, and it will be transcluded to a section called "Other information" at or near the end of the automatic documentation.
For example:
{{Country data Ireland/doc}}
is used to explain why that template is distinct from{{Country data Republic of Ireland}}
{{Country data France/doc}}
is used to document the list of country data templates available for each of the regions of France{{Country data United States/doc}}
is used to document the full set of flag variants (for each number of stars), and to list all of the country data templates available for state and territory flags
Categorization
This template automatically categorizes pages it is transcluded on in Category:All country data templates and in the tracking categories in Category:Country data tracking categories. Content categories, such as those by country or by type/status, should be added manually by putting them inside <includeonly>...</includeonly>
tags on a template's documentation subpage. If a template does not have a documentation page yet, click on the /doc link at the bottom of the automatic documentation, add categories between the preloaded <includeonly>
tags and save the page.
The default sort key used for the automatic categories is the part after Template:Country data in the page title. The parameter |cat=
can be used to specify a custom ASCII sorting key for these categories. For example, {{Country data Åland Islands}}
and {{Country data Republic of Ireland}}
use this parameter to sort them under "A" and "I" respectively.
Automatically added by this template:
- Category:All country data templates (1,095)
- Category:Country data templates with distinct default size (15)
- Category:Country data templates with distinct shortname (295)
- Category:Country data templates with distinct template name (59)
- Category:Country data templates with documentation subpage (315)
- Category:Country data templates without flag alias (6)
- Category:Uncategorized country data templates (781)
Manually added to templates or documentation pages: