模板:Infobox UK place/doc
外观
| 此页面是Template:Infobox UK place的模板文档。 此页面可能包含了模板的使用说明、分类和其他内容。 |
本模板是为兼容已停用模板而建立的、以 {{Infobox settlement}} 为基础的定制信息框。由于本模板现已停用,新建条目时请尽量使用 {{Infobox settlement}}。 |
| 本模板含有复杂而精密的扩展语法。 编辑本模板前,建议您先熟悉解析器函数与本模板的设计思路、运作原理等。若您的编辑引发了意外的问题,请尽快撤销编辑,因为本模板可能被大量页面使用。 您所作的编辑可先在模板沙盒或您的个人页面中进行测试。 |
| 此模板使用Lua语言: |
| 本模板使用以下模板样式: |
本模板为英国地区信息框模板,专门用于英国的人类居住区。
基本语法
[编辑]英文维基百科的“Examples”页面提供了一些使用范例。
完整语法
[编辑]{{Infobox UK place
<!-- BASICS -->
| official_name = <!-- 預設是{{{PAGENAME}}} -->
| 中文名 = <!-- 若不欲顯示{{{PAGENAME}}},可在此欄位輸入替代名稱 -->
| local_name = 英文名称请填入此处
| country = <!-- 英格蘭 | 北愛爾蘭 | 威爾斯 | 蘇格蘭,請勿添加內連 (also produces EU constituency) -->
| crown_dependency = <!-- Isle of Man - NOT [[linked]] (this removes formal mentions of the UK) -->
| region = <!-- (僅用於英格蘭)不加內連 (also produces EU constituency) -->
| region1 = <!-- for places split between regions -->
<!-- IMAGES -->
| static_image = <!-- now deprecated in favour of static_image_name (below); this is used for a static image (most commonly a skyline or landmark) -->
<!-- specified as [[File:filename.jpg|240px]] -->
| static_image_name = <!-- 該地點的圖片,如天際線或著名地標 -->
<!-- specified as filename.jpg -->
| static_image_width = <!-- 圖像寬度,在多數情況下可予忽略(初始值為240px)-->
| static_image_caption = <!-- 圖片的文字說明,可選 -->
| static_image_alt = <!-- for a description of the image per [[WP:ALT]] -->
| static_image_2 = <!-- now deprecated in favour of static_image_2_name (below); this is used for a second static image (for example a town crest) -->
<!-- specified as [[File:filename.jpg|240px]] -->
| static_image_2_name = <!-- 第二張圖片 -->
| static_image_2_width = <!-- allows control of the image width. Should not exceed 240 可控制圖像寬度,不應超過240px -->
| static_image_2_caption = <!-- 第二張圖片的文字說明,可選 -->
| static_image_2_alt = <!-- for a description of the image per [[WP:ALT]] -->
<!-- STATISTICS -->
| area_total_sq_mi = <!-- square mile data as a number - 自動提供平方英里數值 -->
| area_total_km2 = <!-- sq km data as a number - 自動提供平方公里數值(如果此項留空)-->
| area_footnotes= <!-- to cite the values used in the area fields. Use the <ref> </ref> tags -->
| population = <!-- 輸入數字 -->
| population_ref = <!-- 附註:例如<ref>“2001年普查”</ref> -->
<!-- a good place to check for these figures is http://neighbourhood.statistics.gov.uk/ -->
<!-- 任何非純數字的人口數值應放在此項,例如 "約500" 或 "少於500" -->
| population_density = <!-- for /sq mi ...use convert template {{Pop density mi2 to km2|(enter value) |precision=1|abbr=yes}} -->
<!-- if pop density/km<sup>2</sup> is known use {{Pop density km2 to mi2|(enter value) |precision=1|abbr=yes}} -->
<!-- 注意:若“population”有指定數值,或“area_total_sq_mi”與“area_total_km2”二者其中之一有指定數值,則“population_density”會自動計算(如果手動編輯“population_density”則除外)-->
<!-- MAP & LOCATION -->
| os_grid_reference =
| map_type = <!-- type of map (leave blank for default map, or set to nomap, UK or Greater Belfast to force a particular map) -->
| map_alt = <!-- alt text for map, for visually impaired and other readers who cannot see the image; see </nowiki>[[WP:ALT]]<nowiki> -->
| longitude = <!-- location of the place, puts a dot on the map -->
| latitude = <!-- location of the place, puts a dot on the map -->
| label_position = <!-- adjust position of label by dot – defaults to right -->
| scale = <!-- optionally include a scale parameter in the coordinates link (default is city scale) -->
| post_town = <!-- e.g. UXBRIDGE - 自動顯示為大寫,請勿譯成中文 -->
| post_town1 = <!-- 位處多個郵鎮中的地點一 -->
| post_town2 = <!-- 位處多個郵鎮中的地點二 -->
| postcode_area = <!-- e.g. UB -->
| postcode_area1 = <!-- 有多個郵區編號的地點一 -->
| postcode_area2 = <!-- 有多個郵區編號的地點二 -->
| postcode_district = <!-- e.g. UB1, UB2 (this is displayed) -->
| postcode_district1 = <!-- 有多個郵區編號的地點一 -->
| postcode_district2 = <!-- 有多個郵區編號的地點二 -->
| dial_code = <!-- e.g. 020, 0161 or 01332 - NOT +44... -->
| dial_code1 = <!-- for places with more than one dial code -->
| dial_code2 = <!-- for places with more than one dial code -->
<!-- GOVERNANCE -->
| constituency_westminster = <!-- 國會選區(使用連結,如[[奧爾德肖特 (英國國會選區)|奧爾德肖特]])-->
| constituency_westminster1 = <!-- 如果多於一個選區,則使用此類帶有序號的參數 -->
| constituency_westminster2 = <!-- for places in more than one constituency. Use a link. -->
| constituency_westminster3 = <!-- for places in more than one constituency. Use a link. -->
| civil_parish = <!-- for places within a parish. Use a link, e.g. [[Odd Rode]] -->
| civil_parish1 = <!-- for places in more than one parish. Use a link. -->
<!-- DISTANCES -->
<!-- you can use the template {{convert|(enter data)|mi|precision=0}} to help convert miles to km automatically; both are displayed -->
| london_distance_mi = <!-- for UK articles (outside of Greater London), distance to London as the crow flies -->
| london_distance_km =
| london_distance =
| london_direction =
| belfast_distance_mi = <!-- 僅用於北愛爾蘭 -->
| belfast_distance_km =
| belfast_distance =
| belfast_direction =
| cardiff_distance_mi = <!-- 僅用於威爾斯 -->
| cardiff_distance_km =
| cardiff_distance =
| cardiff_direction =
| dublin_distance_mi = <!-- in addition to Belfast data for places in Northern Ireland if they are also relatively near Dublin -->
| dublin_distance_km =
| dublin_distance =
| dublin_direction =
| edinburgh_distance_mi = <!-- 僅用於蘇格蘭 -->
| edinburgh_distance_km =
| edinburgh_distance =
| edinburgh_direction =
| douglas_distance_mi = <!-- 僅用於曼島 -->
| douglas_distance_km =
| douglas_distance =
| douglas_direction =
| charingX_distance_mi = <!-- 僅用於大倫敦以內的地方 -->
| charingX_distance_km =
| charingX_distance =
| charingX_direction =
<!-- SCOTLAND-SPECIFIC -->
| gaelic_name =
| scots_name =
| unitary_scotland =
| unitary_scotland1 = <!-- for places in more than one -->
| lieutenancy_scotland =
| lieutenancy_scotland1 = <!-- for places in more than one -->
| constituency_scottish_parliament =
| constituency_scottish_parliament1 = <!-- for places in more than one constituency -->
| constituency_scottish_parliament2 = <!-- for places in more than one constituency -->
<!-- WALES-SPECIFIC -->
| welsh_name =
| community_wales = <!-- Use a link, e.g. [[Eglwyscummin]] -->
| unitary_wales =
| unitary_wales1 = <!-- for places in more than one -->
| lieutenancy_wales =
| lieutenancy_wales1 = <!-- for places in more than one -->
| constituency_welsh_assembly =
| constituency_welsh_assembly1 = <!-- for places in more than one constituency -->
| constituency_welsh_assembly2 = <!-- for places in more than one constituency -->
<!-- NORTHERN IRELAND-SPECIFIC -->
| irish_name =
| irish_grid_reference =
| unitary_northern_ireland =
| unitary_northern_ireland1 = <!-- for places in more than one -->
| unitary_northern_ireland2 = <!-- for places in more than one -->
| lieutenancy_northern_ireland =
| lieutenancy_northern_ireland1 = <!-- for places in more than one -->
| lieutenancy_northern_ireland2 = <!-- for places in more than one -->
| constituency_ni_assembly =
| constituency_ni_assembly1 = <!-- for places in more than one -->
<!-- ISLE OF MAN-SPECIFIC -->
| manx_name =
| manx_parish = <!-- for places in the Isle of Man -->
| manx_shedding = <!-- for places in the Isle of Man, also generates emergency services -->
| constituency_manx_parliament = <!-- for House of Keys constituency -->
<!-- ENGLAND-SPECIFIC -->
| metropolitan_borough =
| metropolitan_borough1 = <!-- for places in more than one -->
| metropolitan_county = <!-- Use a link. e.g. [[Tyne and Wear]] -->
| metropolitan_county1 = <!-- for places in more than one -->
| shire_district =
| shire_district1 = <!-- for places in more than one -->
| shire_county = <!-- Use a link. e.g. [[Devon]] -->
| shire_county1 = <!-- for places in more than one -->
| unitary_england =
| unitary_england1 = <!-- for places in more than one -->
| lieutenancy_england = <!-- not required where shire or metropolitan is the same -->
| lieutenancy_england1 = <!-- for places in more than one -->
| london_borough = <!-- this should not be linked and simplified: e.g. Bromley NOT [[London Borough of Bromley]] -->
<!-- (also produces London Assembly constituency) -->
| london_borough1 = <!-- for places in more than one borough (also produces London Assembly constituency) -->
| london_borough2 = <!-- for places in more than one borough (also produces London Assembly constituency) -->
| london_borough3 = <!-- special cases, does not produce London Assembly constituency) -->
| london_borough4 = <!-- special cases, does not produce London Assembly constituency) -->
| cornish_name =
<!-- ALL AREAS -->
| other_language_name = <!-- 任何其他語言的名稱 -->
| other_language = <!-- 任何其他語種 -->
| language = <!-- 任何本地方言 -->
| language1 = <!-- 任何本地方言 -->
| language2 = <!-- 任何本地方言 -->
| website = <!-- Council website for place (specifically) -->
| hide_services = <!-- 如果均為紅連,可用“hide_services=yes”隱藏「警察/消防/救護」-->
}}
参数
[编辑]自动功能
[编辑]| 功能 | 必填参数 |
|---|---|
| 基本功能 | |
| 地图 |
|
| 紧急服务 |
可用“hide_services=yes”隐藏此项
|
| 邮政 | |
| 欧洲议会选区 |
|
| 伦敦议会选区 |
|
| 页尾列表(此项已停用) |
|
常用功能
[编辑]| 以下内容一般需要填入 |
|---|
可选功能
[编辑]| 可选功能 | 必填字段 |
|---|---|
| Other language names | gaelic_name 或 scots_name 或 welsh_name 或 irish_name 或 cornish_name 或 manx_name |
| Any other language name | other_language 和 other_language_name
|
| Languages spoken | language |
| Static image(s) |
|
| Map label position |
|
| Area |
|
| Population figures |
|
| Distance from capitals | 用“belfast”“cardiff”“douglas”“dublin”“edinburgh”或“london”代替“<capital>”
|
| Distance within London | 与上述的“Distance from capitals”相同 |
| Civil parish 或 Community |
|
| Website link |
|
跨过边界的地方
[编辑]| 跨过边界的地方 |
|---|
|
很多地点横跨数个邮镇、选区或其他地区。当这种情况发生时,使用其自身所在区域:
|
常见错误
[编辑]- “Location map”出现“检查到模板循环”错误。
- 原因:找不到合适的“Location map”,请检查相关的“Location map”模板是否存在,行政区划的参数是否遗漏,或与“Template:Infobox UK place/local”内的数据是否不匹配。
- “人口”出现“表达式错误!‘{{{population}}}’必须是数字”。
- 请将填入“population”参数的非数字内容移入“population_ref”参数内。
微格式
[编辑]本模板产生的HTML记号包含了HCard 微格式,能够让电脑解析地点名称和位置,具有可自动将文章分类至适当类别的功能。在HCard中有Geo微格式,能让电脑分析经纬度资料,因此可在地图上查询,或下载至全球定位系统(GPS)装置。关于微格式的更多使用信息,请参阅维基百科的微格式专题。
hCard 使用以下的 HTML class:
adrcounty-namefnlabellocalitynicknamenoteorgvcard
Geo由{{coord}}产生,并使用以下的HTML class:
geolatitudelongtitude
请勿将这些class更名或删除。
当指定经纬度数值时,请避免太过详细。
追踪分类
[编辑]参见
[编辑]