コンテンツにスキップ

英文维基 | 中文维基 | 日文维基 | 草榴社区

利用者:Omotecho/sandbox/Templare:Flag2/doc

{{Documentation subpage}} {{high-risk|≈ 460000}}

This template is used to display a small flag icon next to a wikilinked country name. It is related to the {{flagicon}}, {{flagcountry}} and {{flagu}} templates, but offers more options in terms of the text string displayed.

See en:Wikipedia:WikiProject Flag Template for the main documentation/discussion page for the flag templates system.

Usage

[編集]

{{flag|country identifier|optional variant|name=alternative text string|size=maximum width and/or height of the flag image}}

  • country identifier is the common name of the country (e.g. "United States"), a common alias (e.g. "US"), or a standard country code such as those listed at en:ISO 3166-1 alpha-3
  • variant is an optional second parameter that can be used to display a flag variation, such as a historical flag. The list of variants for each country is documented on the appropriate template page, such as en:Template:Country data Germany
  • alternative text string, this optional value, specified by the name parameter, is used to display alternative text
  • size, this optional value is specified by the size parameter, and is used to specify the maximum width and/or height of the flag image. This parameter is specified using standard image syntax.

See the prefix index for the templates latently called by this one.

Examples

[編集]
Wiki markup Displays Notes
{{flag|United States}} アメリカ合衆国の旗 アメリカ Note that all instances link to en:United States.
{{flag|US}} アメリカ合衆国の旗 アメリカ
{{flag|USA}} アメリカ合衆国の旗 アメリカ合衆国
{{flag|Bangladesh}} バングラデシュの旗 バングラデシュ
{{flag|Germany}} ドイツの旗 ドイツ All three instances link to en:Germany.
In addition to the ISO country codes, those used by en:FIFA, en:IOC, etc. are also supported.
{{flag|DEU}} ドイツの旗 ドイツ
{{flag|GER}} ドイツの旗 ドイツ
{{flag|Germany|empire}} ドイツの旗 ドイツ Flag variations can be used with country names or country codes.
{{flag|DEU|empire}} ドイツの旗 ドイツ
{{flag|BAN|1971}} バングラデシュの旗 バングラデシュ
{{flag|CAN|name=Canadian}} カナダの旗 Canadian The name parameter can be used to change the display string but keep the link to the correct article.
{{flag|Canada|1957|name=Canadian}} カナダの旗 Canadian The name parameter can also be used when flag variants are specified.
{{flag|Texas}} テキサス州の旗 テキサス州 Flags are also available for several sub-national and multi-national entities such as US states, Canadian provinces, and the en:European Union.
A complete list can be found at ★en:Category:Country data templates.
{{flag|British Columbia|name=BC}} ブリティッシュコロンビア州の旗 BC
{{flag|EU}} 欧州連合の旗 欧州連合
{{flag|Switzerland|size=14px}} スイスの旗 スイス The size parameter can be used to control the image dimensions.
23×15px is the default size for most countries (some entities have a different default size).
{{flag|Switzerland|size=28px}} スイスの旗 スイス

TemplateData

[編集]
これはビジュアルエディターテンプレートウィザードにより使用されるテンプレートのためのTemplateData文書です。

Omotecho/sandbox/Templare:Flag2

This template displays a small flag icon next to a wikilinked country name

テンプレートパラメーター

パラメーター説明状態
Country identifier1

Common name of the country (e.g. 'United States'), a common alias (e.g. 'US'), or a standard country code

文字列必須
Variant2

Identifies a flag variant to be used instead of the standard flag, e.g. 1815

文字列省略可能
Alternative textname

Display alternative text instead of the standard country name

文字列省略可能
Maximum dimensionsize

The maximum width or height, specified via standard 'extended image syntax' (e.g. x30px)

文字列省略可能

See: en:Wikipedia:Extended image syntax.

See also

[編集]
Template Description Example
{{Coat of arms}} displays coat of arms image  Germany
{{Flagcountry}} always expands the link text to the full country name ドイツの旗 ドイツ
{{Flagu}} does not link the country name ドイツの旗 ドイツ
{{Flagicon}} displays the flag only, linked to the country name ドイツの旗
{{Flagdeco}} displays an unlinked flag icon only
{{Flagc}} links the flag image to its description page Template:Flagc
{{Flaglist}} aligns country names correctly in vertical lists (see that template's documentation) ドイツ
{{Flagteam}} adds country code in parentheses after linked country name  ドイツ (GER)
{{Flagathlete}} displays the flag and another name, followed country name or code  en:Dirk Nowitzki (GER)
{{Flagmedalist}} displays the flag and a name, above linked country name and code en:Dirk Nowitzki
 ドイツ (GER)

See en:Wikipedia:WikiProject Flag Template#List for a longer list of flag templates.

Multi-sport templates

[編集]

<includeonly>{{Sandbox other|| [[Category:Flag template system]] }}</includeonly>