Template:Flagicon

From Hattrick

[edit] Template documentation

Description

Displays a flag of the named parameter in "icon" size, currently 20x12 pixels plus a one pixel border. The image also has an alt attribute (usually "Flag of name"), which is displayed by Internet Explorer when hovering over the flag image, or interpreted by screen reader software and browsers with images disabled.

Usage

{{flagicon|name|size=|altlink=}}

name
The first parameter is mandatory, and identifies the name of the country, region, city, etc. A full list of available parameters can be found in Category:Country data templates. For example, Template:Country data Polska is used when the name parameter is specified as Polska.
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.
altlink
This parameter is optional, and is used to link the flag into an article.

Examples

Wikicode Results Notes
{{flagicon|Polska}} Polska
{{flagicon|Poland}} Polska
{{flagicon|POL}} Polska Uses the FIFA country code
{{flagicon|Polska|link=Polska}} Polska Link to article
{{flagicon|Polska|size=50px}} Polska Sets width to 50 pixels
{{flagicon|POL|size=999x30px}} Polska Sets height to 20 pixels

Implementation notes

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

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, Poland).