Template:Flag country/doc
| File:Edit-copy green.svg | This is a documentation subpage for Template:Flag country. It may contain usage information, categories and other content that is not part of the original template page. |
| Warning | This template is used on approximately 38,000 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. |
Description
{{flag country|nation|variant|size=|name=}}
Produces a flag icon attached to a wikilinked article. This template is similar to the more widely used {{flag}} template, but is more useful for two situations described below.
Parameters
|1=(first unnamed parameter): Use either the name of the nation or in some cases, a three-letter country code (e.g. ISO 3166-1 alpha-3)|variant=or|2=(optional parameter): Specifies an alternative (historical) flag to use. This parameter is documented by the appropriate template in Category:Country data templates.|size=(optional): Can be used to change the flag icon size.|name=(optional): The display text of the target wikilink is usually automatically generated, but can always be over-ridden with the name parameter.
Usage examples
{{flag country|ITA}}→ File:Flag of Italy.svg Italy- In this case, the country code for Italy (ITA) is used to produce the correct flag and wikilink. In many cases, it would probably be preferable to use {{flag}} to produce the same result, such as
{{flag|Italy}}for this example. However, {{flag country}} could be used within other templates (such as infoboxes) so that country codes can be used for those template parameters.
- In this case, the country code for Italy (ITA) is used to produce the correct flag and wikilink. In many cases, it would probably be preferable to use {{flag}} to produce the same result, such as
{{flag country|ITA|1861}}→ File:Flag of Italy (1861–1946).svg Italy- Similar to the first example, but with a flag variant parameter to select a historical flag image. (The wikilinked article is
[[Italy]].)
- Similar to the first example, but with a flag variant parameter to select a historical flag image. (The wikilinked article is
{{flag country|Kingdom of Italy}}→ File:Flag of Italy (1861-1946) crowned.svg Italy- In this example, a different country data template is used, to select an alternative article for the wikilink (in this case,
[[Kingdom of Italy|Italy]]). Compare with{{flag|Kingdom of Italy}}→ File:Flag of Italy (1861-1946) crowned.svg Kingdom of Italy, in which "Kingdom of Italy" is the display text for the wikilink. Therefore, the choice offlag countryorflagdepends on the desired display text; in all other respects, the templates are identical.
- In this example, a different country data template is used, to select an alternative article for the wikilink (in this case,
{{flag country|South Korea|name=Korea}}→
Korea
Tracking categories
TemplateData
TemplateData for Flag country
<templatedata> { "description": "Produces a flag icon next to a wikilinked country name.", "params": { "1": { "label": "Nation", "description": "The name or code of the country.", "type": "string", "required": true }, "variant": { "label": "Variant", "description": "The flag variant to be displayed.", "aliases": [ "2" ], "type": "string" }, "size": { "label": "Size", "description": "The size of the flag icon.", "type": "number" } }, "paramOrder": [ "1", "variant", "size" ] } </templatedata>
See also
- Template:Coat of arms
- Template:Flag
- Template:Flag icon - displays just the flag
- Template:Flagu - displays the flag and unlinked country name
- Template:Flaglist - names line up vertically in lists
- Wikipedia:WikiProject Flag Template