• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Flagicon

  • Template
  • Talk
  • Language
  • Watch
  • View source
Template documentation[view] [edit] [history] [purge]
WarningThis template is used on 501,000+ pages, or roughly 56% of all pages.
To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them.

Template:Flagicon displays a flag of the named parameter in "icon" size, currently 23×15 pixels maximally (defined in Template:Flagicon/core), plus a one-pixel border. The image also has a clickable link to the associated article. For an unlinked flag icon, use Template:Flagdeco instead.

Please consider the Manual of Style section on flags before using this template.

Contents

  • 1 Usage
  • 2 Template data
  • 3 Examples
  • 4 Implementation notes
  • 5 Related templates
  • 6 See also

Usage

{{flagicon|name|variant=|size=}}

name
The first parameter is mandatory, and identifies the name of the country, region, city, etc. A full list of available values can be found in Category:Country data templates. For example, Template:Country data Bulgaria is used when the name parameter is specified as Bulgaria. Many flags are also available via shortened "aliases", such as standard three-letter country codes as specified by ISO 3166-1 alpha-3, IOC, or FIFA. The list of available "aliases" is found in Category:Country data redirects. Many of these country codes could be considered obscure, so it is recommended to use the full country name.
variant
The second parameter is optional, and identifies a flag variant to be used instead of the standard flag. This is most often used for historical flags but can also be used to specify naval flags, sport-use flags, etc. The list of available flag variants for each country is documented on the specific page for the country data template. For example, Template:Country data Bulgaria includes a description of each of the available flag variations for Bulgaria. This parameter can be a named parameter (e.g.. "variant=1815"), or a positional parameter, always after the country name.
size
This parameter is optional, and is used to specify the maximum width and/or height of the flag image. This parameter is specified using standard image syntax.

Template data

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Flagicon in articles based on its TemplateData.

TemplateData for Flagicon

This template displays a wikilinked flag of the named parameter in 'icon' size, currently 23×15 pixels (defined in Template:Flagicon/core) plus a one-pixel border.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Name1

Name of the country, region, city, etc.; full name is recommended for countries

Stringrequired
Variantvariant

Identifies a flag variant to be used instead of the standard flag, e.g. 1815

Stringoptional
Maximum dimensionsize

The maximum width or height, specified via standard 'extended image syntax' (e.g. x30px)

Stringoptional

Examples

Wikicode Results Notes
{{flagicon|Bulgaria}} Bulgaria
{{flagicon|BUL}} Bulgaria Uses the ISO/IOC/FIFA country code
{{flagicon|Bulgaria|1946}} Bulgaria Specifies a historical flag
{{flagicon|Bulgaria|variant=1946}} Bulgaria
{{flagicon|BUL|naval}} Bulgaria Specifies the naval ensign
{{flagicon|BUL|air force}} Bulgaria Specifies the air force flag
{{flagicon|Bulgaria|size=50px}} Bulgaria Sets width to 50 pixels
{{flagicon|BUL|naval|size=x30px}} Bulgaria Sets height to 30 pixels

Implementation notes

This template uses the data templates listed under Category:Country data templates, which contain the data specifying what to display and the formatter Template:Flagicon/core, which contains the logic of how to display the flag.

  • {{flagicon|Bulgaria}} → Bulgaria — uses Template:Country data Bulgaria
  • {{flagicon|BUL}} → Bulgaria — uses Template:Country data BUL, which is a redirect to Template:Country data Bulgaria

Inside each country data template, this template uses the following parameters:

  • flag alias — name of the image file to display
  • flag alias-xxxx — name of the image file of flag variant xxxx
  • alias — used to display the alt attribute of the image (defaults to "Flag of alias")

Related templates

  • Template:Flag is used to display a wikilinked name next to the flag. The displayed name will be the same as the parameter used with the template, but the link target will be the main article for the country (in these examples, Bulgaria).
    • {{flag|Bulgaria}} →  Bulgaria
    • {{flag|BUL}} →  BUL
  • Template:Flagcountry is also used to display a wikilinked name next to the flag. The displayed name will always be the same, regardless of whether or not a country code alias is used as the template parameter.
    • {{flagcountry|Bulgaria}} →  Bulgaria
    • {{flagcountry|BUL}} →  Bulgaria
  • Template:Flagdeco displays an unlinked flag icon without country name.
    • {{flagdeco|Bulgaria}} →

For a full list of flag templates, see Category:Flag template system.

See also

  • Template:Coat of arms
  • WikiProject Flag Template at English
The documentation on top is transcluded from Template:Flagicon/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://simple.wikipedia.org/w/index.php?title=Template:Flagicon&oldid=7467135"
Last edited on 9 April 2021, at 10:57

Languages

    • Acèh
    • Afrikaans
    • አማርኛ
    • Anarâškielâ
    • Ænglisc
    • Аԥсшәа
    • العربية
    • ܐܪܡܝܐ
    • Արեւմտահայերէն
    • Arpetan
    • অসমীয়া
    • Asturianu
    • अवधी
    • Авар
    • Azərbaycanca
    • تۆرکجه
    • Basa Bali
    • বাংলা
    • Banjar
    • 閩南語 / Bân-lâm-gú
    • Basa Banyumasan
    • Башҡортса
    • Беларуская
    • भोजपुरी
    • Bikol Central
    • Български
    • བོད་ཡིག
    • Bosanski
    • Буряад
    • Català
    • Чӑвашла
    • Cebuano
    • Čeština
    • Chavacano de Zamboanga
    • Chi-Chewa
    • Corsu
    • Cymraeg
    • Dagbanli
    • Dansk
    • الدارجة
    • Davvisámegiella
    • ދިވެހިބަސް
    • डोटेली
    • Eesti
    • Ελληνικά
    • English
    • Эрзянь
    • فارسی
    • Fiji Hindi
    • Føroyskt
    • Français
    • Furlan
    • Gaeilge
    • Gagauz
    • Gàidhlig
    • Galego
    • 贛語
    • گیلکی
    • ગુજરાતી
    • गोंयची कोंकणी / Gõychi Konknni
    • 客家語 / Hak-kâ-ngî
    • 한국어
    • Hausa
    • Հայերեն
    • हिन्दी
    • Hrvatski
    • Bahasa Hulontalo
    • Ilokano
    • Bahasa Indonesia
    • Interlingua
    • Ирон
    • IsiXhosa
    • IsiZulu
    • Íslenska
    • Italiano
    • Jawa
    • Kalaallisut
    • ಕನ್ನಡ
    • Kapampangan
    • Къарачай-малкъар
    • ქართული
    • Қазақша
    • Kiswahili
    • Kreyòl ayisyen
    • Kurdî
    • Кыргызча
    • Ladin
    • Ladino
    • ລາວ
    • Latina
    • Latviešu
    • Lëtzebuergesch
    • Lietuvių
    • Ligure
    • Lingála
    • Luganda
    • Magyar
    • मैथिली
    • Македонски
    • മലയാളം
    • Malti
    • Māori
    • मराठी
    • مصرى
    • ဘာသာမန်
    • مازِرونی
    • Bahasa Melayu
    • Minangkabau
    • 閩東語 / Mìng-dĕ̤ng-ngṳ̄
    • Mirandés
    • Мокшень
    • Монгол
    • မြန်မာဘာသာ
    • Nederlands
    • नेपाली
    • 日本語
    • Napulitano
    • Нохчийн
    • Norsk bokmål
    • Norsk nynorsk
    • Novial
    • Occitan
    • Олык марий
    • ଓଡ଼ିଆ
    • Oʻzbekcha / ўзбекча
    • ਪੰਜਾਬੀ
    • پنجابی
    • ပအိုဝ်ႏဘာႏသာႏ
    • پښتو
    • Перем коми
    • ភាសាខ្មែរ
    • Tok Pisin
    • Polski
    • Português
    • Qaraqalpaqsha
    • Română
    • Русский
    • Саха тыла
    • Sakizaya
    • Gagana Samoa
    • संस्कृतम्
    • ᱥᱟᱱᱛᱟᱲᱤ
    • Sardu
    • Scots
    • Sicilianu
    • සිංහල
    • سنڌي
    • Slovenčina
    • Slovenščina
    • Ślůnski
    • Soomaaliga
    • کوردی
    • Српски / srpski
    • Srpskohrvatski / српскохрватски
    • Suomi
    • Svenska
    • Tagalog
    • தமிழ்
    • Taqbaylit
    • Tarandíne
    • Татарча / tatarça
    • တႆး
    • తెలుగు
    • ไทย
    • Thuɔŋjäŋ
    • ትግርኛ
    • Тоҷикӣ
    • ತುಳು
    • Türkçe
    • Türkmençe
    • Тыва дыл
    • Basa Ugi
    • Українська
    • اردو
    • ئۇيغۇرچە / Uyghurche
    • Vèneto
    • Tiếng Việt
    • 文言
    • Winaray
    • 吴语
    • Xitsonga
    • Yorùbá
    • 粵語
    • Zazaki
    • Žemaitėška
    • 中文
    • Bajau Sama
    • Kadazandusun
    • ꠍꠤꠟꠐꠤ
    • ᥖᥭᥰ ᥖᥬᥲ ᥑᥨᥒᥰ
    • ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last changed on 9 April 2021, at 10:57.
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop