Template:Flagicon/doc
Jump to navigation
Jump to search
This is a documentation subpage for Template:Flagicon. It contains usage information, categories and other content or metadata that is not part of the original template. |
Usage
To display the flag of a country or territory along with its name linked to a relevant page:
- First parameter (mandatory): name of the country for the flag icon itself, also used by default as the target page name to link, and the (auto-translated) country name to display.
- Some flag icons use a leading article which must be specified here, even if it is not displayed in the link, so in that case you must specify the following optional parameters. Note that some leading "the" articles needed in image names can be inferred for known country names.
- The name should be in English only, because this template assumes the following file name:
File:Flag of (the) name.svg
. - The actual images can be borrowed in this wiki from Wikimedia Commons (see for example w:c:Category:SVG sovereign state flags for national flags, or w:c:Category:SVG flags of dependent territories for flags of dependent territories) where they are normally stored with their description page.
- Second parameter (optional): alternative name for the link to the target page of the country or territory.
- Otherwise use the same name as set in the first parameter, and translate it automatically according to the language selected.
- May be needed to show a completely different place name that has no icon by itself but reuses the same flag of a parent country or territory (specified in the first parameter), or if you want to link to a specific project page related to that country or territory.
- The link will use automatically the page for the appropriate language (if the target page has available translations) and should not include any language code prefix, but it may specify a namespace prefix (such as "Category:").
- Third parameter (optional): alternative name to display for the country or territory (may be needed for formatting, or for additional precisions to display).
- Otherwise use the same name as set in the second parameter, or in the first parameter if the second parameter is not set.
- This parameter may contain formatting options (but not links), and may need to be numbered explicitly if the specified value includes an equal sign (see the second example below).
lang=code
(optional): used to translate the country or territory name given in the mandatory first parameter, when the optional second parameter is not set.- If this optional language code is not specified, the language of the current page will be used, as determined by {{Langcode}}).
notext=1
(optional): if set to a non-empty value, removes the displayed text and link, just shows the flag icon with its link to the page for the country or territory.- The optional third parameter will not be used if
notext=1
is used.
- The optional third parameter will not be used if
Examples
- {{Flagicon|United States}} : United States
- {{Flagicon|United States|3= United States of America }} : United States of America
- {{Flagicon|the United States}} : the United States – not recommended (the leading article should be omitted, it is detected for most image names)
- {{Flagicon|the United States|United States}} : United States – preferred to the previous one to remove the article in the page name displayed and used
- {{Flagicon|the United States|3= United States of America }} : United States of America – not recommended (the target article name generally has no article)
- {{Flagicon|the United States|United States|United States of America}} : United States of America – preferred to the previous one
- {{Flagicon|the United States|Category:United States|Category for the United States of America}} : Category for the United States of America
- {{Flagicon|United States|lang= fr }} : États-Unis – same as 1st example but rendered for French
- {{Flagicon|United States|3= États-Unis d’Amérique |lang= fr }} : États-Unis d’Amérique – same as 2nd example but rendered for French
- {{Flagicon|Belgium}} : Belgium
- {{Flagicon|Belgium|lang= fr }} : Belgique
- {{Flagicon|Belgium|3= Kingdom of Belgium }} : Kingdom of Belgium
- {{Flagicon|Belgium|3= Royaume de Belgique |lang= fr }} : Royaume de Belgique
- {{Flagicon|Belgium|Category:Belgium}} : Belgium
- {{Flagicon|Belgium|Category:Belgium|Category for Belgium}} : Category for Belgium
- {{Flagicon|Belgium|Category:Belgium|lang= fr }} : Belgique
- {{Flagicon|Belgium|Category:Belgium|Catégorie : Belgique|lang= fr }} : Catégorie : Belgique
- {{Flagicon|Quebec|notext= 1 }} :
- {{Flagicon|Quebec}} : Quebec
- {{Flagicon|Quebec|lang= fr }} : Quebec
- {{Flagicon|Quebec|Québec|lang= fr }} : Québec
- {{Flagicon|Finland|Åland Islands|notext= 1 }} :
- {{Flagicon|Finland|Åland Islands|Åland Islands <small>(Finland)</small>}} : Åland Islands (Finland)
See also
- {{Flag char}} – plain text alternative that does not impact page loading time
- {{CountryNameLang}} – for translating country/territory names (including the preposition "of", possibly with a genitive or locative case and a suitable article)