How Can We Help?
You are here:
< Back

Templates for displaying a tiny flag image or other country information.

Country templates

The {{country|Action|CountryName}} template is used to display various information about a country.

  • Shortcuts:
    • {{flagcountry}}: {{flagcountry|CountryName}}: Same as country|flagcountry.
    • {{flag}}: {{flag|CountryName}}: Flag icon with text linked to country page. (implemented with country|flag) Allows optional parameters size= for image size and name= for a text label.
    • {{flagicon}}: {{flagicon|CountryName}}: Same as country|flagicon.
    • {{flagIOC}}: {{ISO|CountryName}}: Same as country|flagIOC.
    • {{ISO|flag}}: {{ISO|flag|CountryName}}: Same as country|flagISO.
    • {{ISO|code}}: {{ISO|code|CountryName}}: Produces ISO code: {{ISO|code|United States}}: Template:ISO
  • country|flag: {{country|flag|CountryName}}: Flag icon with text linked to country page.
    • Each CountryName is connected to a flag file, a Wikipedia article name, and text label. The flag file and text label are displayed, with a link to the Wikipedia article.
  • country|flagcountry: {{country|flagcountry|CountryName}}: Flag icon with short name of country linked to article.
  • country|flagicon: {{country|flagicon|CountryName}}: Flag icon alone.
  • country|flagISO: {{country|flagISO|CountryName}}: Flag icon with text linked to country page; name is an ISO 3166-1 country code.
  • country|flagIOC: {{country|flagIOC|CountryName}}: Flag icon with text linked to country's Olympics page; name is an International Olympic Committee country code (see List of IOC country codes).
    • IOC country code usage:
      1. An IOC country code should be used only for general reference to that country's Olympic activities.
      2. Use modified country codes such as RUS-SFSR for historical references to Games where a country's reference has changed (ie, different flag).
  • All flags using these templates have a similar appearance.
  • Implemented by invoking {{country|flag|CountryName}}.
    • Uses sub-templates to alias various names for a country to a specific name.
      • At present, all supported countries must have sub-templates. Need better incantation or create templates.
        • A couple of hundred countries have to be supported, plus aliases.
        • Two/three letter abbreviations for each country.
        • Some countries have aliases: US, USA, United States, United States of America.
    • Displays aliased Image file name.
    • Displays aliased text label (ie, "US" is aliased to "USA").
    • Links label to Wikipedia article (ie, "US" is linked to United States)
    • The same alias definitions are used by several of the flag templates (flag without label, flag with abbreviation, flag with country name).
      • Template data array definitions, such as aliases, can be redirected to a single definition for a country.
  • Aliases for smaller entities follow the pattern COUNTRY-STATE, such as US-MN for the USA state of Minnesota (MN).

Examples:

Editing flag description

{{countryedit|CountryName|IOC abbreviation}}: Displays a table with links to the fields which are used by {{country}} and {{flag}} templates.

Example of {{countryedit|USA|USA|USA}}:

Template:Countryedit

For a country without an ISO code or IOC code use an empty parameter (nothing after the | symbol. An ISO country code may be displayed from a lookup table.
{{countryedit|USA||}}:

Template:Countryedit Template:Countryedit

Implementation

The technology being used is called a template array: a group of templates whose names follow patterns which are used to address them. For example, the common programming array address A(1,2) can be represented as Template:array_A_1_2.

Defined template array entries appear in this list: templates starting with country_

Template arrays for these templates follow the convention: country_AliasType_alias_CountryName

  • country_: prefix used by templates related to {{country}}.
  • AliasType: optional indicator of type of alias.
  • _alias_: suffix to indicate end of alias type.
  • CountryName: name of country which is being addressed.
    • CountryName-Modifier is also used, for historical or component references, such as Russian-SFSR to refer to Russia while a member of the USSR, or US-WI to refer to the US state of Wisconsin.

Aliasing example

Referenced as Template addressed Value in template Usage
US country_alias_US United States Wikipedia article: United States
US country_flag_alias_US Flag of the United States.png Flag: Template:Country data flagicon
US country_label_alias_US USA Small text label: Template:Country data flag
US country_shortname_alias_US United States Short country name: Template:Country data flagcountry

Flag creation guidelines

Format

  • Format: Use SVG format. It is preferred for drawings and iconic images. Images should be properly prepared for upload.
  • Size: Use a size large enough to contain all the detail. It is easily shrunk to a desired size.

License

License: Use the appropriate license message from Image copyright tags. The summary below is a selection from the full list.

  • {{PD}} - for when author has put into the public domain or the author died over 70 years ago (pre-1935). Consider first using the following subtags:
    • {{PD-flag-US}} - for images of national, governmental, or historical flags out of copyright in the United States
    • {{PD-flag-50}} - for images of national, governmental, or historical flags out of copyright in those countries with copyright terms of life of the author plus 50 years
    • {{PD-flag-70}} - for images of national, governmental, or historical flags out of copyright in those countries with copyright terms of life of the author plus 70 years
    • {{PD-flag-100}} - for images of national, governmental, or historical flags out of copyright in those countries with copyright terms of life of the author plus 100 years
  • Messages used with flags which are not properly identified:
    • {{PD-flag}} - images of flags marked as public domain when in fact they might not be. Source information is often needed and licence information should be added if necessary.

Commons

It is not currently possible to use an image uploaded to one Wikimedia project in another one without re-uploading it. If you want to use the same image in more than one project, you can upload it to Wikimedia Commons and it would become immediately accessible from all Wikimedia projects. Note that Commons only accepts free images (public domain or licensed under a free license). If the image is fair use, you can't upload it to Commons. To upload the image existing on Wikipedia to another project you will need to download the image to your own computer (often right clicking on it will give you this option), and then re-upload that to the place you want the image to be copied to. Interlanguage links can be added between the two.

Country information definition

Including the countryedit template on the flag's page helps ensure the proper information is defined.

Finding flag images

Places to find flags:

Future development

I am using the template array technology. There are proposed technologies which may be better. (SEWilco 05:46, 9 Jun 2005 (UTC))

Archives

/Archive1: Archive of project when testing of flag template was completed. June 23 2005

Categories
Table of Contents