ويكيبيديا:WikiProject Flag Template
This WikiProject is responsible for the template system used to create Flag icons, with or without associated wikilinks. This project is only concerned with the implementation of these templates.
- See Wikipedia:WikiProject Heraldry and vexillology for issues regarding the Flag images themselves.
- See Wikipedia:Manual of Style (Flags) for guidelines about Flag icon usage.
Main templates
[تعديل]Produces a small image of the named Flag. The image has a link to the article associated with the Flag.
- Example:
<span class="flagicon">[[ملف:Flag of Japan.svg|23x15px|border |alt=Japan|link=Japan]]</span>
→
Produces a small image of the named Flag, plus a wikilink to the associated article. The icon image does not have a link (unlike Flag icon
) so that screen readers do not render the name twice.
- Example:
<span class="flagicon">[[ملف:Flag of the United Kingdom.svg|23x15px|border |alt=|link=]] </span>[[المملكه المتحده|United Kingdom]]
→United Kingdom
![]() | Note that this wikicode sequence: {{country data <var>name</var>|flag icon/core|variant=|size=}}[[تصنيف:Flag icons missing country data templates]] [[<var>name</var>]] can be (and should be) replaced by the simpler: {{country data <var>name</var> |flag/core |name=<var>name</var> | حجم = | border= | altlink = }} . |
Similar to Flag
, but the associated country name is unlinked. This template should be used in articles with WP:OVERLINK concerns (e.g. when the same Flag is used many times in a single table).
- Example:
<span class="flagicon">[[ملف:Flag of the United States.svg|23x15px|border |alt=|link=]] </span>[[امريكا|United States]]
→United States
Similar to Flag
, but always uses the preferred display text for the wikilinked article. Useful when the input parameter can be a country code, or is a long-form country name because it links to a different article, such as for a historical country.
Examples: | <span class="flagicon">[[ملف:Flag of Italy (1861-1946) crowned.svg|23x15px|border |alt=|link=]] </span>[[مملكه ايطاليا|Kingdom of Italy]] → ![]() |
<span class="flagicon">[[ملف:Flag of Bangladesh.svg|23x15px|border |alt=|link=]] </span>[[بانجلاديش|BAN]] → ![]() | |
<span class="flagicon">[[ملف:Flag of the Philippines.svg|23x15px|border |alt=|link=]] </span>[[الفيليبين|PHI]] → ![]() |
Compare with Flag
, which always uses the first parameter as display name (unless when overridden with [[#name|name]]
):
<span class="flagicon">[[ملف:Flag of Italy (1861-1946) crowned.svg|23x15px|border |alt=|link=]] </span>[[مملكه ايطاليا|Kingdom of Italy]]
→Kingdom of Italy
<span class="flagicon">[[ملف:Flag of Bangladesh.svg|23x15px|border |alt=|link=]] </span>[[بانجلاديش|BAN]]
→BAN
Displays a Flag of the named parameter in "icon" size, currently 23x15 pixels plus a one pixel border. This template is very similar to قالب:Flag icon, except the image is not linked to an article, i.e. it is "purely decorative" per World Wide Web Consortium (W3C) Web Content Accessibility Guidelines (WCAG). This template can be used when the article text immediately adjacent to the icon provides the associated link for the Flag.
- Comparison example
{{Flag icon|United Nations}}
→الامم المتحده
{{Flagdeco|United Nations}}
→
- Usage examples
<span class="flagicon">[[ملف:Flag of the United States.svg|23x15px|border |alt=|link=]]</span> [[List of Presidents of the United States]]
→List of Presidents of the United States
<span class="flagicon">[[ملف:Flag of France.svg|23x15px|border |alt=|link=]]</span> [[الجمهوريه الفرنسيه الاولى]]
→الجمهوريه الفرنسيه الاولى
"Shortcut" Flag templates
[تعديل]Many countries also have individual Flag templates, named using standard three letter country codes so as to offer "shortcut" alternatives to the standard templates. This is a mixed blessing; some country codes (like "USA") are widely known and the corresponding shortcut templates (i.e. [[ملف:Flag of United States.svg|20px|border]] [[امريكا]]
) offer convenience, but some country codes are relatively obscure, so wiki markup would likely be clearer if the country names were spelled out in full. Also, the shortcut templates do not offer the ability to use historical Flag variants (described below), and are therefore less flexible.
- Example:
[[ملف:Flag of Belgium.svg|20px|Belgique]] [[بلجيكا]]
→بلجيكا (equivalent to
<span class="flagicon">[[ملف:Flag of Belgium (civil).svg|23x15px|border |alt=|link=]] </span>[[بلچيكا|Belgium]]
)
See Wikipedia:Inline templates linking country articles for a complete list.
List
[تعديل]Besides the ones mentioned above, many other Flag templates exist. This (probably incomplete) list excludes the military (see #Military Flag templates) and sports templates (see #National sport team Flag templates). See each template's documentation for more details.
Template | Description | Example |
---|---|---|
{{علم}} | Unlinked icon with country link | {{Flag|موناكو}} ← ![]() |
{{Flagbig}} | Large Flag icon; name and icon separated by line break | {{Flagbig|موناكو}} ← ![]() موناكو |
{{Flagc}} | Icon links to file description page (for attribution) | {{Flagc|موناكو}} ← ![]() |
{{Flagcountry}} | Displays default country name instead of first parameter | {{Flagcountry|MON}} ← ![]() |
{{Flagdeco}} | Unlinked Flag icon only | {{Flagdeco|موناكو}} ← ![]() |
{{Flag icon}} | Icon only, linked to country page | {{Flag icon|موناكو}} ← ![]() |
{{Flagg}} | The most general Flag template; many different output formats are possible depending on first parameter | {{Flagg|isb|موناكو}} ← ![]() |
{{Flaglink}} | Changes the link to one with text after the country name | {{Flaglink|موناكو|in the Eurovision Song Contest}} ← ![]() |
{{Flag+link}} | Changes the link to one with text before the country name, with existence check | {{Flag+link|History of|موناكو}} ← ![]() |
{{Flaglist}} | Aligns country names correctly in vertical lists | {{Flaglist|موناكو}} ← ![]() |
{{Flagof}} | Links to the article on the country's Flag | {{Flagof|موناكو}} ← ![]() |
{{Flagright}} | Icon after name | {{Flagright|موناكو}} ← ![]() |
{{Flagu}} | Unlinked country name | {{Flagu|موناكو}} ← ![]() |
|
Extracts one or more data field values from a template | {{getalias|موناكو|Flag}} ← موناكو
|
The following templates do not technically use the Flag template system, but are used similarly:
Template | Description | Example |
---|---|---|
{{flagicon image}} | Formats a Flag with specified filename similarly to {{Flagdeco}} (for use if no data template exists). | {{flagicon image|Lozenge Flag of موناكو.svg}} ← ملف:Lozenge Flag of موناكو.svg
|
{{noflag}} | Returns the first parameter with whitespace to its left, if one entry in a vertical list doesn't/shouldn't have an icon | {{<span class="nowrap">{{</span>[[قالب:noflag|noflag]]<span class="nowrap">}}</span>|[[موناكو]]}} ← {{{{noflag}}|موناكو}}
|
Flag names
[تعديل]The first (positional) parameter for these templates specifies the country (or other entity) to be used for the Flag image. These actually identify additional templates that individually store information specific to that country. For example, the image name and main article name used by <span class="flagicon">[[ملف:Flag of Norway.svg|23x15px|border |alt=|link=]] </span>[[النرويج|Norway]]
(to produce Norway
) is stored in قالب:Country data Norway. The complete set of these "country data" templates is found in Category:Country data templates.
Note that there are country data templates for many entities that are not considered countries, such as international organizations or sub-national entities. The use of "country" in these template names is only because the original implementation of the Flag template system was built upon قالب:Flag A better name might have been "Flag data", but it is likely too late for that change now.
Some examples of non-country Flag templates are:
<span class="flagicon">[[ملف:Flag of the United Nations.svg|23x15px|border |alt=|link=]] </span>[[الامم المتحده|الامم المتحده]]
→الامم المتحده
<span class="flagicon">[[ملف:Flag of Europe.svg|23x15px|border |alt=|link=]] </span>[[الاتحاد الاوروبى|الاتحاد الأوروبي]]
→الاتحاد الأوروبي
<span class="flagicon">[[ملف:Flag of Catalonia.svg|23x15px|border |alt=|link=]] </span>[[Catalonia|Catalonia]]
→Catalonia
<span class="flagicon">[[ملف:Flag of Canton of Bern.svg|23x15px|border |alt=|link=]] </span>[[كانتون بيرن|Bern]]
→Bern
<span class="flagicon">[[ملف:Flag of Bangladesh.svg|23x15px|border |alt=|link=]] </span>[[بنغلاديش|بانجلاديش]]
→بانجلاديش
Many country data templates also exist for historical nations, and these can be used to produce the historical Flags with wikilinks to the appropriate articles. Some examples are:
<span class="flagicon">[[ملف:Flag of Austria-Hungary (1867–1918).svg|23x15px|border |alt=|link=]] </span>[[الامبراطوريه النمساويه المجريه|Austria-Hungary]]
→Austria-Hungary
<span class="flagicon">[[ملف:Flag of Germany (1935–1945).svg|23x15px|border |alt=|link=]] </span>[[المانيا النازيه|Nazi Germany]]
→Nazi Germany
<span class="flagicon">[[ملف:Flag of the Soviet Union.svg|23x15px|border |alt=|link=]] </span>[[الاتحاد السوفييتى|Soviet Union]]
→Soviet Union
<span class="flagicon">[[ملف:Flag of Yugoslavia (1946-1992).svg|23x15px|border |alt=|link=]] </span>[[Socialist Federal Republic of Yugoslavia|Yugoslavia]]
→Yugoslavia
Alias names
[تعديل]For added convenience, many Flags can be identified by an alias name, typically a three-letter country code. For example, instead of <span class="flagicon">[[ملف:Flag of France.svg|23x15px|border |alt=فرنسا|link=فرنسا]]</span>
, you could simply use <span class="flagicon">[[ملف:Flag of France.svg|23x15px|border |alt=فرنسا|link=فرنسا]]</span>
to produce .
Alias names are available for almost every nation listed in ايزو 3166-1 الفا-3, the قائمة رموز بلدان اللجنة الأولمبية الدولية, and the لستة كود الفيفا. For example, <span class="flagicon">[[ملف:Flag of Germany.svg|23x15px|border |alt=المانيا|link=المانيا]]</span>
(ISO) and <span class="flagicon">[[ملف:Flag of Germany.svg|23x15px|border |alt=المانيا|link=المانيا]]</span>
(IOC and FIFA) both produce . A small handful of other well-known abbreviations are also available (such as
UK
, EU
, and USSR
).
Alias names are implemented as redirects in the template namespace. For example, قالب:Country data VEN is a redirect to قالب:Country data Venezuela. The complete set of these redirects is listed in Category:Country data redirects, and the available alias redirect(s) for a given country data template (if any) are also documented on that template's page.
When using country code aliases, template Flag
will display this value for the wikilink's display text. For example:
<span class="flagicon">[[ملف:Flag of the United States.svg|23x15px|border |alt=|link=]] </span>[[امريكا|امريكا]]
→امريكا
<span class="flagicon">[[ملف:Flag of the United Kingdom.svg|23x15px|border |alt=|link=]] </span>[[المملكه المتحده|UK]]
→UK
<span class="flagicon">[[ملف:Flag of the People's Republic of China.svg|23x15px|border |alt=|link=]] </span>[[الصين|CHN]]
→CHN
Note that in each case, the target wikilink points to the correct article name (i.e. امريكا, المملكه المتحده, and الصين, respectively) but the display text matches the input parameter to template Flag
. This may be the desired effect, such as in column headings of a large table, but if the full name is wanted, then use قالب:علم بلد instead:
<span class="flagicon">[[ملف:Flag of the United States.svg|23x15px|border |alt=|link=]] </span>[[امريكا|امريكا]]
→امريكا
<span class="flagicon">[[ملف:Flag of the United Kingdom.svg|23x15px|border |alt=|link=]] </span>[[المملكه المتحده|UK]]
→UK
<span class="flagicon">[[ملف:Flag of the People's Republic of China.svg|23x15px|border |alt=|link=]] </span>[[الصين|CHN]]
→CHN
Alias names have a second purpose, which is to provide alternative display text for target wikilinks. For example, the main article linked by قالب:Country data East Germany is المانيا الشرقيه, but قالب:Country data German Democratic Republic is a redirect alias. Therefore, you can use <span class="flagicon">[[ملف:Flag of East Germany.svg|23x15px|border |alt=|link=]] </span>[[المانيا الشرقيه|German Democratic Republic]]
for German Democratic Republic
. Again, note that the target article name for the generated wikilink is still المانيا الشرقيه.
Flag variants
[تعديل]Many countries have had different Flag variations at various periods in their history. The Flag template system can accommodate this by storing multiple Flag variants inside country data templates. A specific Flag variant is selected by specifying an additional parameter to any of the standard Flag templates. This parameter is usually given as the second positional parameter to the template, but may also be given as the variant
named parameter.
- Examples
<span class="flagicon">[[ملف:Flag of Germany.svg|23x15px|border |alt=|link=]] </span>[[المانيا|Germany]]
→Germany
<span class="flagicon">[[ملف:Flag of Germany.svg|23x15px|border |alt=|link=]] </span>[[المانيا|Germany]]
→Germany
<span class="flagicon">[[ملف:Flag of Bangladesh.svg|23x15px|border |alt=|link=]] </span>[[بانجلاديش|Bangladesh]]
→Bangladesh
<span class="flagicon">[[ملف:Flag of Bangladesh (1971).svg|23x15px|border |alt=بانجلاديش|link=بانجلاديش]]</span>
→<span class="flagicon">[[ملف:Flag of Canada (Pantone).svg|23x15px|border |alt=|link=]] </span>[[كندا|كندا]]
→كندا
<span class="flagicon">[[ملف:Canadian Red Ensign (1921–1957).svg|23x15px|border |alt=كندا|link=كندا]]</span>
→
The set of available Flag variants (if any) for a specific country data template are documented on the country data template page itself. Each variant is identified by a short text label, such as empire
or 1921
in the examples above. Usually, the label identifies the year in which the Flag was introduced, but this is not a mandatory style convention.
Other common parameters
[تعديل]Size
[تعديل]The default size for all Flag icons created by these templates is 23x15px, with a one pixel border. That is, the icon will be no more than 23 pixels wide, and no more than 15 pixels tall. These dimensions were carefully chosen to generate the best results when Flag icons are used in a bulleted list with the default browser text size. Some countries (mostly those with square or near-square Flags) have different default sizes.
In certain situations, it might be desirable to use a larger (or smaller) size, and this is enabled with the size
named parameter, available with all standard templates.
- Examples
<span class="flagicon">[[ملف:Flag of Monaco.svg|23x15px|border |alt=|link=]] </span>[[موناكو|موناكو]]
→موناكو
<span class="flagicon">[[ملف:Flag of Bangladesh.svg|40px|border |alt=بنغلاديش|link=بنغلاديش]]</span>
→<span style="font-size:85%;"> <span class="flagicon">[[ملف:Flag of Belgium (civil).svg|23x15px|border |alt=|link=]] </span>[[بلچيكا|Belgium]] </span>
→ {{small|Belgium
Name
[تعديل]The display text of the target wikilink is usually automatically generated, but can always be over-ridden with the name
parameter.
- Examples
<span class="flagicon">[[ملف:Flag of South Korea.svg|23x15px|border |alt=|link=]] </span>[[كوريا الجنوبيه|Korea]]
→Korea
(this name is used in several sports)
<span class="flagicon">[[ملف:Flag of the Republic of China.svg|23x15px|border |alt=|link=]] </span>[[جمهورية الصين|China]]
→China
(China from 1912 to 1949)
![]() | Note that if the name parameter is used, then the Flagcountry and Flag templates are functionally identical. Use template Flag for shorter wikicode. |
Military Flag templates
[تعديل]Displays the naval ensign of the named country (identified as the naval
variant in the corresponding country data template) plus a wikilink to the main article for the country's navy. Note that the naval ensign for many countries is the same as the national Flag. Also note that the WP:SHIPS and WP:MILHIST conventions are to use naval ensigns, not naval jacks when identifying ships with Flag icons.
Examples
<span class="flagicon">[[ملف:Flag of the United Kingdom.svg|22x20px|border |alt=|link=]]</span> [[قوات المملكه المتحده البحرية ]]
→قوات المملكه المتحده البحرية
<span class="flagicon">[[ملف:Flag of the United States.svg|22x20px|border |alt=|link=]]</span> [[قوات امريكا البحرية ]]
→قوات امريكا البحرية
Displays a country's army or war Flag (the army
variant) and a wikilink to the country's army.
Examples
<span class="flagicon">[[ملف:Flag of the United Kingdom.svg|22x20px|border |alt=|link=]]</span> [[جيش المملكه المتحده ]]
→جيش المملكه المتحده
<span class="flagicon">[[ملف:Flag of the United States.svg|22x20px|border |alt=|link=]]</span> [[جيش امريكا ]]
→جيش امريكا
<span class="flagicon">[[ملف:Flag of Bangladesh.svg|22x20px|border |alt=|link=]]</span> [[جيش بانجلاديش ]]
→جيش بانجلاديش
Displays a country's air force Flag (the air force
variant) and a wikilink to the country's air force.
Examples
<span class="flagicon">[[ملف:Flag of the United Kingdom.svg|22x20px|border |alt=|link=]]</span> [[قوات المملكه المتحده الجوية ]]
→قوات المملكه المتحده الجوية
<span class="flagicon">[[ملف:Flag of the United States.svg|22x20px|border |alt=|link=]]</span> [[قوات امريكا الجوية ]]
→قوات امريكا الجوية
National sport team Flag templates
[تعديل]One of the most common instances of Flag icon usage on Wikipedia is for national sport teams. Several sets of sport-specific templates have been developed to also use this Flag template system:
- قالب:bb for بيسبول
- قالب:bd for ريشه طايره
- قالب:bk for كورة سله
- قالب:Cr for كريكيت
- قالب:Fb for كورة قدم (soccer)
- قالب:Fh for field hockey
- قالب:hb for كورة اليد
- قالب:Ih for هوكى الجليد
- قالب:Nb for netball
- قالب:Rl for دورى الرجبى
- قالب:Ru icon for اتحاد الرجبى
- قالب:ru7 for rugby sevens
- قالب:vb for كرة الطايره
- قالب:Davis and قالب:Fed for تنس (كاس ديڤيس and كاس الاتحاد)
- قالب:bandy for bandy
- قالب:korf for korfball
- قالب:speedway for motorcycle speedway
These templates have intentionally been given terse names because they tend to be used many, many times on individual pages for match results. They completely supersede a set of previously used national team-specific templates. For example, <span class="flagicon">[[ملف:Flag of Italy.svg|23x15px|border |alt=|link=]] </span>[[فريق ايطاليا لكورة القدم|ايطاليا]]
replaced [[Image:Flag of Italy.svg|20px|border]] [[فريق ايطاليا لكورة القدم]]
, <span class="languageicon">(in Russian)</span>
replaced {{{NZLru}}
<span class="flagicon">[[ملف:Flag of Bangladesh.svg|23x15px|border |alt=|link=]] </span>[[ فريق بنغلاديش national cricket team|بنغلاديش]]
replaced {{BCB}}
, etc.
There are often several template variations available for a given sport:
- with a "w" suffix, links to women's national team articles instead
- with a "-rt" suffix, renders the Flag icon to the right of the nation's name instead of to the left. This formatting style is often used in match results
- with a -big" suffix, renders the Flag icon in larger size and the team name underneath the Flag. This formatting style is often used in tables of tournament results.
For example, for football, the following templates are used:
Team | Standard | Right Flag | Big Flag |
---|---|---|---|
Men's national teams | {{fb}} | {{fb-rt}} | {{fb-big}} |
Examples | ![]() |
![]() |
![]() المانيا |
Women's national teams | {{fbw}} | {{ك ق س-يم}} | {{fbw-big}} |
Examples | ![]() |
نيديرلاند ![]() |
![]() المانيا |
User preference to disable display of Flag icons
[تعديل]Users that do not like Flag icons can disable them with a preference setting. A CSS class is used within the internal formatting template, and the class setting can be changed from a user's personal CSS file (skin-specific, cross-skin, or global).
Flag icon image rendering is disabled by:
.Flag icon { display: none; }
Implementation
[تعديل]Three types of templates are used by the Flag template system, each with a different function:
- User-transcluded templates
- Country data templates (internal)
- Formatting templates (internal)
For example, <span class="flagicon">[[ملف:Flag of Spain.svg|23x15px|border |alt=|link=]] </span>[[اسبانيا|Spain]]
, uses:
- قالب:Flag, to accept input parameters, such as the country name (mandatory) and the optional Flag variant, size, and wikilink display name.
- قالب:Country data Spain, to supply the image name and article name
- قالب:Country Flag2, to actually render the image icon and wikilink
This system architecture means that:
- all country-specific data is contained within individual country data templates, improving maintainability
- the formatting wikicode is centralized in a very small number of templates, ensuring consistency
How it works
[تعديل]There are three steps in each Flag template invocation.
In the previous example of <span class="flagicon">[[ملف:Flag of Spain.svg|23x15px|border |alt=|link=]] </span>[[اسبانيا|Spain]]
, the templates expand as follows:
First, Template:Flag
expands to invoke Template:Country data Spain
, and ensure that all user-specified parameters are set. The first parameter to the country data template is actually the name of the formatting template. This is the mechanism by which the same country data template can be used with multiple different formatting templates. Therefore, the first step of expansion results in:
{{معطيات إسبانيا| Flag/core | variant = | size = | name = Spain}}
If the variant
(or second positional parameter), the size
, and/or name
parameters were specified in the user invocation, these would be set to the desired value. For example, <span class="flagicon">[[ملف:Flag of Spain.svg|23x15px|border |alt=|link=]] </span>[[اسبانيا|España]]
would expand to:
{{معطيات إسبانيا| Flag/core | variant = 1939 | size = | name = España}}
Next, the country data template expands to invoke the formatting template, plus add all the country-specific parameters. Going back to the simpler example of <span class="flagicon">[[ملف:Flag of Spain.svg|23x15px|border |alt=|link=]] </span>[[اسبانيا|Spain]]
, the second expansion results in:
{{Country Flag2| alias = Spain | Flag alias = Flag of Spain.svg | name = Spain}}
Lastly, the formatting template is expanded to produce:
<span class="Flag icon">[[ملف:Flag of Spain.svg|23x15px|border |alt=|link=]] </span>[[اسبانيا]]
Basic country data template structure
[تعديل]The structure of all country data templates follows a standard pattern, which is extended to include additional parameters only when necessary. The empty boilerplate for all country data templates is as follows:
{{ {{{1<noinclude>|country showdata</noinclude>}}} | alias = | Flag alias = | size = {{{size|}}} | name = {{{name|}}} }}
There are two essential values that must be specified:
- The
alias
value identifies the name of the main article associated with the Flag. - The
Flag alias
value identifies the image name of the default Flag.
The invocation of country showdata
on the first line is used to automatically generate the template documentation, as described below.
The {{{1}}}
and {{{1}}}
statements ensure that any user-specified size and/or name values are passed through from the outer template (Flag
, Flag icon
, etc.) to the inner formatting template. Omission of these lines from the country data template would cause the size and name functionality to be disabled.
Adding Flag variants
[تعديل]Additional Flag variants are specified by individual Flag alias
statements. The unique label for the variant is the suffix of the parameter name, as Flag alias-''label''
(don't forget the hyphen). For example, قالب:Country data Mexico has several Flag variants, one of which is specified by:
| Flag alias-1934 = Flag of Mexico (1934-1968).png
Therefore, when <span class="flagicon">[[ملف:Flag of Mexico.svg|23x15px|border |alt=|link=]] </span>[[المكسيك|Mexico]]
is transcluded, Image:Flag of Mexico (1934-1968).png is rendered. The selection of the Flag variant is coded in the formatting templates.
Country data templates with at least one Flag variant (in addition to the default) must also have the following line:
| variant = {{{variant|}}}
Similar to the size
and name
parameters as described above, this statement is required to pass the variant value (e.g. 1934
) from the outer Flag template to the inner formatting template. Omission of this line will cause the Flag variant selection to fail.
Disabling image border
[تعديل]If some Flags are non-standard in shape and a 1px border is undesirable (for example for Nepal), then the border for the main Flag may be defeated by adding the parameter
|border =
To remove the border for certain variant Flags only, use the pattern |border-variant=
, replacing variant
with the respective variant label. For example:
|border-1976 = |border-colonial =
Nothing should be added after the equal sign(s). See قالب:بيانات بولاندا for examples of this usage.
Due to the coding of the Flag templates, disabling the border for the main Flag also automatically disables it for all Flag variants. If the main Flag should not have a border but any of the variants should, the respective |border-variant=
parameters must be explicitly set to "border" to re-enable the 1px border:
|border-1976 = border
Changing the wikilink display text
[تعديل]The best results are obtained when the template name matches the article wikilink (as specified by the alias
value). For example, قالب:Country data Russia contains {{{1}}}
, which results in a target wikilink to روسيا.
However, there are instances where the main article name contains a disambiguation string. For example, قالب:Country data Georgia contains {{{1}}}
. Therefore, <span class="flagicon">[[ملف:Flag of Georgia.svg|23x15px|border |alt=|link=]] </span>[[Georgia (country)|جورجيا]]
results in جورجيا
. Note that the wikilink is جورجيا, but the display string is "Georgia", as expected.
In these instances, an additional statement is needed to support قالب:علم بلد properly. The shortname alias
parameter should be set to the desired text string, such as {{{1}}}
. In effect, the resultant wikilink will be generated as [[''alias''|''shortname alias'']]
, or [[جورجيا]]
in this specific example.
Changing the page being linked to
[تعديل]The templates {{Flaglink}} and {{Flag+link}} append and prepend text to the link target, respectively. For example, to link to the education system in a table comparing different countries' educational outcomes, use
{{Flag+link|Education in|Finland}}
Which results in Finland.
For link targets that do not start or end with the country name, use the {{Flagdeco}} template (which returns an unlinked Flag icon without text) followed by a standard wikilink:
{{Flagdeco|Finland}} [[Example page|Finland]]
Which would look like this: فينلاندا.
National sport team template parameters
[تعديل]Any country data template that will be used with a national team template must include an additional "pass-through" parameter:
| altlink = {{{altlink|}}}
This parameter is used to form the suffix of the associated wikilink. For example, قالب:Cr appends "national cricket team" to the country name (alias
value), and this process is enabled by the altlink
parameter.
In most cases, the Flag and display name for national teams corresponds to the same Flag and display name normally used for the nation. However, in some instances these can be over-ridden by additional parameters within the country data template. The default wikilink can also be changed in cases where the common naming convention is not used.
Some examples:
- كوريا الجنوبيه is referred to as "Korea Republic" by فيفا. Therefore, قالب:Country data South Korea includes
name alias-football
so that<span class="flagicon">[[ملف:Flag of South Korea.svg|23x15px|border |alt=|link=]] </span>[[فريق كوريا الجنوبيه لكورة القدم|كوريا الجنوبيه]]
producesكوريا الجنوبيه
- In many sports, all-Ireland teams compete with athletes from both the جمهورية ايرلاندا and ايرلاندا الشماليه, and often under unique Flags for each sport. قالب:Country data Ireland includes unique Flags for several sports teams, such as
{{{1}}}
, so that<span class="flagicon">[[ملف:Flag of Ireland hockey team.svg|23x15px|border |alt=|link=]] </span>[[ فريق ايرلاندا national field hockey team|ايرلاندا]]
producesايرلاندا
- The New Zealand netball team is described at the منتخب نيوزيلندا لكورة الشبكه article, so to avoid the redirect at New Zealand national netball team, قالب:Country data New Zealand contains
{{{1}}}
so that<span class="nowrap"><strong class="error"><span class="scribunto-error mw-scribunto-error−87f184cc">خطأ: لا توجد وحدة بهذا الاسم "رقم".</span></strong></span>
produces خطأ: لا توجد وحدة بهذا الاسم "رقم".
In each of these examples, the over-ride parameter (name alias-football
, Flag alias-field hockey
, or link alias-netball
) is identified by a unique per-sport variable that is passed from the appropriate sport team template. For example, قالب:Fb includes {{{1}}}
. Therefore, any country data template that utilizes one or more team sport over-ride parameters must also include:
| altvar = {{{altvar|}}}
Template documentation
[تعديل]Country data templates "self-document" themselves through قالب:Country showdata. Recall that the first line of each country data template is an invocation to a formatting template, defaulting to country showdata
if that parameter is missing:
For simple country data templates, nothing further needs to be done to document them. If any Flag variants, redirect aliases, etc. are used with the template, they are documented by adding parameters specifically for use by country showdata
. These extra parameters are enclosed in a ....
section as they should not be present for any other invocation of the country data template.
See قالب:Country showdata/doc for more information about how to document country data templates.
شوف كمان
[تعديل]- {{Coat of arms}} for coats of arms in infoboxes and lists
- {{FlagIOC}} for a similar template used exclusively for Olympic Games related articles, and uses a different internal mechanism than for these templates.
- {{ShipboxFlag}} for display of Flags in ship infoboxes
- Wikipedia:Manual of Style (Flags), the guideline about use of such Flag icons in articles
- ايزو 3166-1 الفا-3
Internal project templates
[تعديل]- {{WikiProject Flag Template}} – banner for talk pages of template and Flag-related project pages
Archives
[تعديل]- /Archive1 – Archive of project when testing of Flag template was completed. June 23, 2005
- Revision as of 8 January 2007 – description of the previous version of the Flag template system
- Revision as of 3 November 2007 – before this page was completely rewritten