• 首页
  • 随机
  • 登录
  • 设置
  • 关于悠日計画 維基百科 ~ Yuuni Wiki
  • 免责声明
悠日計画 維基百科 ~ Yuuni Wiki

模板:Infobox settlement/pref

  • 语言
  • 监视
  • 查看源代码
< 模板:Infobox settlement
文件:Test Template Info-Icon - Version (2).svg Template documentation[view] [edit] [history] [purge]

This is a subtemplate of {{Infobox settlement}}. It is not intended to be used directly. It is called by the following templates:

  • {{Infobox settlement/areadisp}}
  • {{Infobox settlement/densdisp}}
  • {{Infobox settlement/lengthdisp}}

Its purpose is to determine whether those templates call one of the subtemplates that displays metric units first (the default):

  • {{Infobox settlement/metric}}
  • {{Infobox settlement/metric/mag}}

or one of the subtemplates that displays imperial units (U.S. units) first:

  • {{Infobox settlement/impus}}
  • {{Infobox settlement/impus/mag}}

or the following subtemplates if an area is specified in dunams:

  • {{Infobox settlement/dunam}}
  • {{Infobox settlement/dunam/mag}}

Usage

The template handles up to three unnamed parameters.

  1. Text which specifies preference to display either metric or Imperial units first. It is specified as unit_pref in {{Infobox settlement}}, then passed as pref to one of three display subtemplates (/areadisp, /densdisp, /lengthdisp).
  2. Country name, used to determine preferene when not given in first parameter. It is specified as subdivision_name in {{Infobox settlement}}, then passed as name to one of three display subtemplates.
  3. The third parameter is only specified by the /areadisp subtemplate, which passes the text area.

The default is to display metric units first, so the template only checks these parameters for values that would indicate the need to display non-metric units first:

  1. Imperial, English, UK, US, U.S., US Customary, U.S. Customary, Standard
  2. United Kingdom, [[United Kingdom]], United States, [[United States]], United States of America, [[United States of America]], [[United States|United States of America]]
  3. if this template is called by the /areadisp subtemplate, then it also checks parameter #1 for dunam (after converting it to lowercase)

Examples

Code Result
{{Infobox settlement/pref | | }} metric
{{Infobox settlement/pref | Imperial | }} impus
{{Infobox settlement/pref | UK | }} impus
{{Infobox settlement/pref | US | }} impus
{{Infobox settlement/pref | | United Kingdom}} impus
{{Infobox settlement/pref | | United States}} impus
{{Infobox settlement/pref|Dunam|Other|area}} dunam
{{Infobox settlement/pref|Dunam|Other}} metric
{{Infobox settlement/pref|Dunam|United Kingdom|area}}
In this example, the template never checks for "Dunam" because it previously
found that parameter #2 contained the name of a country using imperial units.
impus

See also

  • {{Infobox settlement/areadisp}}
  • {{Infobox settlement/lengthdisp}}
  • {{Infobox settlement/link}}
  • {{Infobox settlement cleaner}}
The above documentation is transcluded from 模板:Infobox settlement/pref/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
检索自“https://wiki.czzzz.work/index.php?title=模板:Infobox_settlement/pref&oldid=642”
最后编辑于2022年9月18日 (星期日) 21:24

语言

    此页面在其他语言不可用。

    悠日計画 維基百科 ~ Yuuni Wiki
    • 此页面最后编辑于2022年9月18日 (星期日) 21:24。
    • 除非另有声明,本网站内容采用知识共享署名-非商业性使用-相同方式共享授权。
    • 隐私政策
    • 关于悠日計画 維基百科 ~ Yuuni Wiki
    • 免责声明
    • 桌面版