Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Examples  





2 How it works  





3 Usage with custom size  














Template:Flaglist






العربية

تۆرکجه

Bosanski
Буряад
Cymraeg
Dagbanli
Dansk
فارسی

ि
Ilokano
Bahasa Indonesia

Kurdî
Magyar
ि

مصرى
مازِرونی
Bahasa Melayu



ି
Oʻzbekcha / ўзбекча

Português
Română
Scots

Simple English
Slovenščina
کوردی
Српски / srpski
Tagalog
ி
 


Türkçe
Українська
اردو
Tiếng Vit


 
 

Edit links
 









Template
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 





Permanently protected template

From Wikipedia, the free encyclopedia
 


This template is identical to Template:Flag except that the names are aligned correctly with flag icons of different widths. It is for use in lists of countries, states, provinces, etc.. See the documentation of Template:Flag for general documentation and available parameters.

Examples

Example country table using {{flaglist}} and table=yes parameter Example country list using {{flaglist}} Example country list using {{flag}}
 Paraguay
San Marino
 Palau
 Australia
 Nepal
 Brazil
 Iran
 Switzerland
 Qatar
 China
 Niger
Bosnia-Herzegovina
Socialist Republic of Romania
Soviet Union
Hungarian People's Republic
 Ukraine


Union of Soviet Socialist Republics
{| style="margin-left:-3px"
|-
| <span class="flagicon" style="display:inline-block;width:25px;">[[File:Flag of the Soviet Union.svg|23x15px|border |alt=|link=]]</span> 
| style="padding-left:2px;" | [[Soviet Union|Union of Soviet Socialist Republics]]

|}

How it works

{{Flag}} generates a flag icon, a non-breaking space and the country link, which means the alignment of the link depends on the width of the flag image. The default size for flag icons is 23x15px, so the icon width is 23px for long flags but smaller for more squarish flags such as those of San Marino and Niger (any flag with an aspect ratio less than 23/15 ≈ 1.53), misaligning the country links next to them. The {{Flag/core}} template, used internally by {{flag}}, compensates for this for Nepal, Vatican City and Switzerland by inserting some extra spaces, though for several other countries the link is still shifted too far to the left, as seen above.

{{Flaglist}} puts a flag icon inside an invisible <span> box with a fixed width calculated by Module:Flaglist. The width does not depend on the exact dimensions of the image, but does vary with the maximum width and height specified using extended image syntax. The default size for most countries' flags is 23x15px; the |size= parameter can be used if a different size is wanted. Some entities have different defaults specified within their data templates and may output misaligned links even if |size= is not used.

If a maximum width is specified (whether both width and height, e.g. 20x10px, or width only, e.g. 20px), either using the |size= parameter or the data template default, the box size is equal to this width plus seven pixels. If a height is specified but a width is not (x10px), a box width of 2.2 times the height plus seven pixels is used. In the latter case, flags with an aspect ratio greater than 2.2 (the only such current national flag being that of Qatar) may extend beyond the invisible box and overlap the country link at certain sizes, as seen in the table below. For this reason, if an icon size different from the default is wanted, it is best to always specify both a width and a height. This also ensures that neither squarish nor long flags are rendered much bigger than other flags.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Country1

Display the small flag icon of this country. A flag will only be displayed if the related template {{country data ⟨1⟩}} exists with the ⟨flag alias⟩ parameter (otherwise a transparent placeholder is used to preserve text alignment inside lists).

Example
Germany
Stringrequired
Custom namename

Custom name to be displayed instead of ⟨1⟩.

Stringoptional
Short nameshort

Display the ⟨shortname alias⟩ that is configured in the country data template, instead of the name given with ⟨1⟩ or ⟨name⟩. If there is no shortname alias, then ⟨alias⟩ from the country data template is used.

Default
no
Example
yes
Booleansuggested
Flag variant2 variant

Name of a variant that is configured in the country data template to display a flag variation, such as a historical flag.

Example
empire
Stringoptional
Custom flag sizesize

Custom size of the flag icon.

Default
23x15px
Example
x25px
Stringoptional
Table alignmenttable

Align country names that wrap across multiple lines next to the flag icon (by creating a table). Currently only for use within tables.

Default
no
Example
yes
Booleanoptional

Usage with custom size

|size= value {{flag}} output {{flaglist}} output {{flaglist}} with table=yes output
10px
 Qatar
 Palau
Switzerland
Union of Soviet Socialist Republics
x8px
 Qatar
 Palau
Switzerland
Union of Soviet Socialist Republics
10x8px
 Qatar
 Palau
Switzerland
Union of Soviet Socialist Republics
35px
 Qatar
 Palau
Switzerland
Union of Soviet Socialist Republics
x25px
 Qatar
 Palau
Switzerland
Union of Soviet Socialist Republics
35x25px
 Qatar
 Palau
Switzerland
Union of Soviet Socialist Republics

Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Flaglist&oldid=1093707640"

Categories: 
Lua-based templates
Flag template system
Hidden categories: 
Wikipedia semi-protected templates
Test cases using output parameter
 



This page was last edited on 18 June 2022, at 10:14 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki