Difference between revisions of "Template:Flags"

From blackwiki
Jump to navigation Jump to search
imported>QuimGil
(Out of sandbox.)
imported>QuimGil
(Supporting text= aka possibility to add a text and define the link)
Line 1: Line 1:
{{#invoke:Flags | flag |{{{1}}}|{{{2}}}|{{{variant|}}}|{{{size|}}}}}<noinclude>
+
{{#invoke:Flags | flag |{{{1}}}|{{{2}}}|{{{variant|}}}|{{{size|}}}|{{{text}}}}}<noinclude>
 
{{documentation}}</noinclude>
 
{{documentation}}</noinclude>

Revision as of 00:34, 4 July 2013

Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value).

Template documentation[view] [edit] [history] [purge]

Description

This template provides a clicable icon flag with options to define the size, the link and the label. Its usage is especially recommended in articles with many icon flags.

This project is under development. The functionality is solid but you might miss certain flags. See Where is my flag?

Examples: ca:Estats membres de la Unió Europea - ca:Jocs Olímpics - ca:Futbol Club Barcelona - ca:Temporada 2011 de Fórmula 1 - ca:Torneig de Roland Garros 2009

Usage

{{Flags|name|variant|size=|text=|link=}}

name
The first parameter identifies the name of the territory represented by the flag. It is required and must be specified in the first position. It can accept three formats:
  • Full names in English and an optional local language: {{Flags|Andorra}} provides Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value).
  • 2 letter codes according to ISO 3166-1 alpha-2: {{Flags|AD}} provides Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value).
  • 3 letter codes according to ISO 3166-1 alpha-3: {{Flags|AND}} provides Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value).
variant
Optional parameter to define historic flags, militar or with other specific uses. It is possible to combine two types of variants:
  • Year: {{Flags|Andorra|1806}} or {{Flags|Andorra|variant=1806}} provides Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value). / Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value).
  • Type: {{Flags|Regne Unit|naval-RMAS}} provides Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value).
size
Optional parameter to modify the size of the flag. It accepts the usual parameters for maximum sizes of images, keeping the original aspect ratio of the flag:
  • {{Flags|Andorra|size=44px}} provides Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value).
text
Optional parameter to define a label including a link. When no specific text is defined then the label is the name of the flag:
  • {{Flags|Andorra|text=}} provides Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value). and {{Flags|Andorra|text=Principat d'Andorra}} provides Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value).
link
Optional parameter to define a link. When no specific link is define then the link of the flag (and of the label, if any) is removed:
  • {{Flags|Basque Country|link=Basque Country (autonomous community)}} provides Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value). and {{Flags|Basque Country|link=|text=}} provides Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value).

Where is my flag?

When the template doesn't recognize the name of the flag then it returns 20x22px or Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value).

Possible reasons:

In these cases, the template makes a last attempt tryingto find "File:Flag of [name].svg" at Commons.

If you find 20x22px or Lua error in Module:Flags at line 129: attempt to concatenate field '?' (a nil value). please report the problem at Module talk:Flags and we will fix it.

You can also contribute adding names and flags to MasterData (and LocaleData in your non-English wiki), keeping the consistency with Category:Country data templates. It's easy and it doesn't require any technical knowledge.

Development

This template is based on Wikipedia:Lua and is under development. Feedback and feature requests are welcome at Module talk:Flags.

The functionality is provided by Module:Flags.

Module:Flags/MasterData must be published as is in any other wiki, and any changes must be synced here.

LocaleData is specific to wikis of each language. Here we have only an example.