模板:Infobox Switzerland municipality/doc

This is the infobox for articles about specific municipalities of Switzerland. More than 2700 articles are using it.

For a sample use, see Aarau.

Tests for updates

编辑

Before updating the infobox, please try the updates first on the test version at

Blank template

编辑

NOTE: population figures, year and month of the population estimate and a population reference are now added automatically thanks to the templates from Category:Swiss populations data templates. For former municipalities (villages); use either the population from before the merger, N/A or leave the population field blank. The current list of recognized municipalities can be found at the Swiss Federal Statistical Office in either German or French. Look for the Excel file called Amtliches Gemeindeverzeichnis der Schweiz - MS-Excel Version (德语) or Répertoire officiel des communes de Suisse - Version MS-Excel (法语).

NOTE: area is added automatically from Template:Switzerland area data. The area field is still retained in the template as a backup in case the template returns an error. Editing the area will have no effect unless the SFOS number is incorrect or the municipality_type is set to former.

{{Infobox Switzerland municipality
| subject_name         = <!-- English name of the municipality -->
| municipality_name    = <!-- Official name of the municipality, not displayed but used to select a map *2-->
| municipality_type    = <!-- use "former" for municipalities that were merged and no longer exist *1 -->
| imagepath_flag       = <!-- flag of the municipality, "File:" is included automatically. -->
| imagepath_coa        = <!-- coat of arms of the municipality, "File:" is included automatically. -->
| pixel_coa            =
| image_photo          = <!-- a picture of the municipality, "File:" is included automatically. -->
| image_caption        = <!-- a caption describing the photo -->
| snow_image           = <!-- a snow-covered photo of the municipality that will replace the main one for the first four months of the year -->
| snow_imagecaption    = <!-- a caption describing the snowy picture, will be shown along with it in from January to April -->
| map                  = <!-- if no other map is found automatically, this will link a map at the bottom of the infobox *2 -->
| canton               = <!-- English name of the canton without "Canton of" -->
| iso-code-region      = <!-- ISO 3166-2:CH code, e.g. "CH-SG" for St. Gallen -->
| district             = <!-- Needs to be linked, if the canton is not subdivided in districts just write "n.a." -->
| within_municipality  = <!-- For villages and former municipalities, to specify which municipality they're part of -->
| coordinates          = <!-- Latitude and longitude. Use {{Coord}}. -->
| postal_code          = <!-- Postal code(s) assigned to the town. -->
| municipality_code    = <!-- the four-digit SFOS number. Used to retrieve population figures and to link SFOS statistics, plus additional statistics for a number of cantons *3 -->
| area                 = <!-- Used if the municipality_code is incorrect, no longer valid or municipality_type is former.  Area, in km2. XXX.XX (no commas or other text) -->
| elevation            = <!-- in m (no commas or other text) -->
| elevation_description=
| population            = <!-- This parameter must be here to create the POPULATION field in the infobox. However, it is only used if the municipality_code is incorrect, no longer valid or municipality_type is "former". -->
| populationof          = <!-- Used if the municipality_code is incorrect, no longer valid or municipality_type is "former".-->
| popofyear             = 
| highest              = <!-- Highest point in the municipality -->
| highest_m            = <!-- in m (no commas or other text) -->
| lowest               = <!-- Lowest point in the municipality -->
| lowest_m             = <!-- in m (no commas or other text) -->
| position             = <!-- "left" moves the label in the locator map to the left. Useful for cities in the east (e.g. Poschiavo) -->
| website              = <!-- e.g. www.rapperswil-jona.ch – if none is specified the template will link "subject_name.ch", which usually works --> 
| mayor                =
| mayor_asof           =
| mayor_party          =
| mayor_title          =
| list_of_mayors       =
| places               = <!-- a list of villages and other places within the municipality, particularly useful for municipalities created through mergers -->
| demonym              =
| neighboring_municipalities =
}}
  • *1: When the parameter value is "former", population and website information are not shown.
  • *2: if available, a map corresponding to "Karte Gemeinde 'subject_name' 20XX.png", where XX is a year between 07 and 12, will be added automatically.
  • *3: additional statistics are available for municipalities in Canton of Lucerne, Canton of Neuchatel, Ticino, Vaud.

Errors

编辑

Any articles with errors caused by incorrect information in the infobox will appear in Category:Swiss populations data templates/Failure.

Yearly updates

编辑

This template draws data from several sources. These data include the SFOS numbers, population and area. Some of these values will change on a yearly basis.

Template:Switzerland area data check Arealstatistik Standard - Kantonsdaten nach 4 Hauptbereichen (Area statistics) for updates
Template:SFOS2Municipality check Amtliches Gemeindeverzeichnis (Community Directory) for changes to SFOS numbers and mergers.
Category:Swiss populations data templates check Swiss Federal Statistical Office - STAT-TAB online database and update for each canton.

Fields

编辑

Many infoboxes have been converted from the German or the French language Wikipedia. The following table lists fields that are (or used to be) equivalent.

Field en: Field de: Field fr:
subject_name= NAME_ORT= or BILDPFAD_WAPPEN= nomcommune= or drapeaucommune=
(municipality_name=) NAME_ORT= nomcommune=
(imagepath_flag=) BILDPFAD_Flagge= drapeaucommune=
(imagepath_coa=) BILDPFAD_WAPPEN= blasoncommune=
(municipality_type=) GEMEINDEART=
canton= KANTON= canton= or (lien_canton=|affichage_canton=)
district= (with [[]]) BEZIRK= (with [[]]) district= or (lien_district=|affichage_district=)
coordinates= BREITENGRAD=|LÄNGENGRAD= longitude=|latitude=
postal_code= PLZ= cp=
municipal_code= BFS= no_OFS=
population= EINWOHNER= habitants=
populationof= STAND_EINWOHNER=
(populationdensity=) densité=
area= FLÄCHE= superficie=
(area_magnitude=)
altitude= HÖHE= altitude=
mayor= (with [[]]) syndic/maire=
website= WEBSITE= siteweb=
(map= (with [[]])) BILDPFAD_KARTE= carte=
places= localité=
neighboring_municipalities= communeslimitrophes=
(language=) langue=
demonym= nom/gentilé=

Fields with names listed in parentheses are not currently displayed in this template and might never be, but they are assigned a name to facilitate conversion from fr: and de:.

Conversions

编辑
From To
language field content field content
de BILDPFAD_WAPPEN= imagepath_coa=
de STAND_EINWOHNER= Dezember 2006 populationof= December 2006

Microformat

编辑

本模板产生的HTML记号包含了HCard 微格式,能够让电脑解析地点名称和位置,具有可自动将文章分类至适当类别的功能。在HCard中有Geo微格式,能让电脑分析经纬度资料,因此可在地图上查询,或下载至全球定位系统(GPS)装置。关于微格式的更多使用信息,请参阅维基百科的微格式专题

hCard 使用以下的 HTML class:

  • adr
  • county-name
  • fn
  • label
  • locality
  • nickname
  • note
  • org
  • vcard

Geo由{{coord}}产生,并使用以下的HTML class:

  • geo
  • latitude
  • longtitude

请勿将这些class更名或删除。

当指定经纬度数值时,请避免太过详细。

TemplateData

编辑
以下是该模板的模板数据,适用于可视化编辑器等工具。

Infobox Switzerland municipality模板数据

追踪分类

编辑

Hidden tracking/maintenance category implemented in main and supporting templates:

另见

编辑
Supporting template
Other languages