Wikipedia:WikiProject Flag Template
From Wikipedia, the free encyclopedia
Templates for displaying a tiny flag image or other country information.
Contents |
[edit] Available templates
{{flagicon|United Kingdom}} = ![]() |
Displays the flag alone |
{{flagcountry|United Kingdom}} = ![]() |
Displays the flag with a link to the main article of the country |
{{flag|United Kingdom}} = ![]() |
Displays flag with full name of country |
{{flag|GBR}} = ![]() |
Displays flag with abbreviation |
Also see {{flagIOC}} for a similar template used exclusively for Olympic Games related articles, and uses a different internal mechanism than for these templates.
Aliases for country names are available:
- {{flagicon|GBR}} =
- {{flagcountry|GBR}} =
United Kingdom
Optional parameters:
- size — to use a non-default flag size
- {{flagicon|United Kingdom|size=40px}} =
- {{flagcountry|United Kingdom|size=40px}} =
United Kingdom
- {{flagicon|United Kingdom|size=40px}} =
- name — to produce a non-default link-text
- {{flagcountry|United Kingdom|name=This is the United Kingdom's flag}} =
This is the United Kingdom's flag
- {{flagcountry|United Kingdom|name=This is the United Kingdom's flag}} =
[edit] Implementation
The data what to display is contained in country data templates, with a template per country. See category:country data templates for an overview of available countries.
The logic how to display these is contained in formatter templates.
Template | Formatter used |
---|---|
{{flagicon}} | {{country flagicon2}} |
{{flagcountry}} | {{country flagcountry2}} |
As an example, let's dissect the call {{flagcountry|United Kingdom}} (which produces United Kingdom):
- (1) {{flagcountry|United Kingdom}} expands to: {{country data United Kingdom | country flagcountry2 }}
- (2) expands to: {{country flagcountry2 | alias = United Kingdom of Great Britain and Northern Ireland | shortname alias = Great Britain | label alias = GBR | flag alias = Flag of United Kingdom.svg}}
- (3) expands to: [[Image:Flag of United Kingdom.svg|22x20px|Flag of United Kingdom]] [[United Kingdom]]
Aliases for country names are created by using redirects: For example, template:country data GBR is a redirect to template:country data United Kingdom.
[edit] Flag creation guidelines
[edit] 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.
[edit] 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.
[edit] 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.
[edit] Finding flag images
Places to find flags:
- Some flags are in Category:Flags (SEWilco)
- Many flags use Template:PD-flag and thus that page's "What links here" page will show file names. (SEWilco)
- Searches by name can also be done in Special:Imagelist. (SEWilco)
- Wikipedia Commons: commons:Category:National flags. (SEWilco)
[edit] Future development
I am using the template array technology. There are proposed technologies which may be better. (SEWilco 05:46, 9 Jun 2005 (UTC))
- Wikipedia:Category - If templates could use categories, aliases might use them.
- m:Extended template syntax - More flexible template features.
- m:Field-value pairs - Additional data in articles.
- m:Flexible Fields for MediaWiki - Additional data in articles.
[edit] Archives
- /Archive1 – Archive of project when testing of flag template was completed. June 23, 2005
- Revision as of 8 January 2007 – description of the previous version of the flag template system