Difference between revisions of "Template:Flag"
Jump to navigation
Jump to search
m |
m |
||
Line 1: | Line 1: | ||
− | <includeonly>[[Image:{{Flag/ | + | <includeonly>[[Image:{{Flag/abbr|{{{1|}}}}}.png|23x15px|border|{{Flag/abbr|{{{1|}}}}}|link=]]</includeonly><noinclude>{{documentation}}[[Category:Template]]{{#if:{{{1|}}}||[[Category:Unknown Flag]]}}</noinclude> |
Revision as of 13:16, 14 May 2016
(view - edit) Documentation
Template:Flag displays a flag icon.
Usage
{{flag|1}}
1
This is the only parameter in the template and is used for defining which country's flag will be shown.
- All valid settings for flags are listed in the tables below
- This parameter is case-insensitive.
Examples
You type | You get | |
---|---|---|
Full name | {{flag|United Nations}}
|
United Nations |
Alternate name | {{flag|world}}
|
Unknown |
Abbreviation | {{flag|un}}
|
United Nations |
No parameter | {{flag|}}
|
Unknown |
Invalid parameter | {{flag|invalid}}
|
Unknown |
Valid settings
Note: United Kingdom flags
The individual flags of England England, Northern Ireland Northern Ireland, Scotland Scotland, and Wales Wales should take preference in all possible circumstances over the United Kingdom United Kingdom flag.
Misc · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z |
Miscellaneous
A
B
C
D
Democratic Republic of the Congo | cd
|
Democratic Republic of the Congo |
Zaire | ||
Denmark | dk
|
Denmark |
Djibouti | dj
|
Djibouti |
Dominica | dm
|
Dominica |
Dominican Republic | do
|
Dominican Republic |
E
G
I
Iceland | is
|
Iceland |
India | in
|
India |
Indonesia | id
|
Indonesia |
Iran | ir
|
Iran |
Iraq | iq
|
Iraq |
Ireland | ie
|
Ireland |
Israel | il
|
Israel |
Italy | it
|
Italy |
K
Kazakhstan | kz
|
Kazakhstan |
Kenya | ke
|
Kenya |
Kiribati | ki
|
Kiribati |
Kosovo | xk
|
Kosovo |
Kuwait | kw
|
Kuwait |
Kyrgyzstan | kg
|
Kyrgyzstan |
L
Laos | la
|
Laos |
Latvia | lv
|
Latvia |
Lebanon | lb
|
Lebanon |
Lesotho | ls
|
Lesotho |
Liberia | lr
|
Liberia |
Libya | ly
|
Libya |
Liechtenstein | li
|
Liechtenstein |
Lithuania | lt
|
Lithuania |
Luxembourg | lu
|
Luxembourg |
M
N
P
R
Republic of the Congo | cg
|
Republic of the Congo |
Congo | ||
Romania | ro
|
Romania |
Russia | ru
|
Russia |
Rwanda | rw
|
Rwanda |
S
T
U
X
Developer documentation
How this template works
- Template:Flag takes the input parameter and calls a sub-template at "Template:Flag/X". For example,
{{flag|united nations}}
will call Template:Flag/united nations. - This sub-template then in turn calls Template:Flag icon, supplying it with a single parameter (
{{Flag icon|X}}
). For example, Template:Flag/united nations supplies Template:Flag icon with the single parameterUnited Nations
- Template:Flag icon calls for a flag image at "File:Flag of X.png", and applies formatting such as sizing and a 1px border. For example, if Template:Flag icon is given the parameter
United Nations
, it will supply File:Flag of United Nations.png (United Nations).
- Many of the sub-templates (such as the abbreviations and alternate names) are simple redirects to a primary sub-template. For example, Template:Flag/un, Template:Flag/global, Template:Flag/international and Template:Flag/world all redirect to Template:Flag/united nations. Template:Flag/united nations is the primary sub-template which then calls Template:Flag icon.
How to add a flag
If you wish to add a flag, the following requirements must be followed:
Image size
- Width: equal or less than 23px
- Height: equal or less than 15px
- Aspect ratio: retained from source flag
If your flag is a custom flag (e.g. North America), we recommend a 23x15px flag which has a 2:3 ratio.
Upload
- Your flag should be uploaded to
File:Flag of ProperFlagName.png
, whereProperFlagName
is the full name of your flag with correct capitalization - Make sure you add your flag image to Category:Flag Images.
Update templates
- Create a template at
Template:Flag/lowercaseflagname
, wherelowercaseflagname
is the full name of your flag in complete lowercase. This template should contain the code below:
{{Flag icon|'''ProperFlagName'''}}<noinclude>[[Category:Flag sub-templates]]</noinclude>
- Create a template at
Template:Flag/abbr
, whereabbr
is the lowercase abbreviation of your flag. This template should be a simple redirect to the primary sub-template (Template:Flag/lowercaseflagname
)- If your template has any alternate names or abbreviations, create them as simple redirects to the primary sub-template as well
- Add your flag to the correct table in the documentation template.