Template:CityInfobox: Difference between revisions
Jump to navigation
Jump to search
m (Add category) |
m (Fix formula) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{| class="infobox" style="width: 300px; border: solid 1px #AAA;" | <includeonly>{| class="infobox" style="width: 300px; border: solid 1px #AAA;" | ||
|+ style="background-color: #BDBDBD; text-align: center;" | '''{{{Short city name| | |+ style="background-color: #BDBDBD; text-align: center;" | '''{{{Short city name|{{PAGENAME}}}}}''' | ||
|- {{#if: {{{Full city name|}}} | | style="display: none;" }} | |- {{#if: {{{Full city name|}}} | | style="display: none;" }} | ||
! colspan="2" style="background-color: #BDBDBD; text-align: center;" | {{{Full city name|Full name placeholder}}} | ! colspan="2" style="background-color: #BDBDBD; text-align: center;" | {{{Full city name|Full name placeholder}}} | ||
Line 14: | Line 14: | ||
|- | |- | ||
! Country | ! Country | ||
| {{#if: {{{ | | {{#if: {{{country text|}}}|{{{country text}}}|[[{{{country|sample_nation}}}]]}} | ||
|- {{#if: {{{region|}}} | | style="display: none;" }} | |- {{#if: {{{region|}}} | | style="display: none;" }} | ||
! Region | ! Region | ||
Line 39: | Line 39: | ||
|- {{#if: {{{elevation|}}} | | style="display: none;" }} | |- {{#if: {{{elevation|}}} | | style="display: none;" }} | ||
! Elevation | ! Elevation | ||
| {{{elevation|0.00 meters}}} | | {{{elevation|0.00 meters}}} m | ||
|- {{#if: {{{total area|}}} | | style="display: none;" }} | |- {{#if: {{{total area|}}} | | style="display: none;" }} | ||
! Total area | ! Total area | ||
| {{{total area|0.00 km2}}} | | {{{total area|0.00 km2}}} km<sup>2</sup> | ||
|- {{#if: {{{urban area|}}} | | style="display: none;" }} | |- {{#if: {{{urban area|}}} | | style="display: none;" }} | ||
! Urban area | ! Urban area | ||
| {{{urban area|0.00 km2}}} | | {{{urban area|0.00 km2}}} km<sup>2</sup> | ||
|- {{#if: {{{metro area|}}} | | style="display: none;" }} | |- {{#if: {{{metro area|}}} | | style="display: none;" }} | ||
! Metro area | ! Metro area | ||
| {{{metro area|0.00 km2}}} | | {{{metro area|0.00 km2}}} km<sup>2</sup> | ||
|- {{#if: {{{time zone|}}} | | style="display: none;" }} | |- {{#if: {{{time zone|}}} | | style="display: none;" }} | ||
! Time zone | ! Time zone | ||
Line 60: | Line 60: | ||
! Rank | ! Rank | ||
| {{{rank|0th place}}} | | {{{rank|0th place}}} | ||
|- {{#if: {{{density|}}} | | style="display: none;" }} | |- {{#if: {{{density|}}} | | {{#if: {{{total area|}}} | {{#if: {{{population|}}} | | style="display:none;" }} | style="display:none;" }} }} | ||
! Density | ! Density | ||
| {{{density| | | {{#if: {{{density|}}} | {{{density}}}/km<sup>2</sup> | {{#if: {{{total area|}}}{{{population|}}} | {{formatnum: {{#expr: {{formatnum:{{{population}}}|R}}/{{formatnum:{{{total area}}}|R}} round 2 }} }}/km<sup>2</sup> | }} }} | ||
|- {{#if: {{{demonym|}}} | | style="display: none;" }} | |- {{#if: {{{demonym|}}} | | style="display: none;" }} | ||
! Demonym | ! Demonym | ||
| {{{demonym|tbc}}} | | {{{demonym|tbc}}} | ||
|}<noinclude>[[Category:Infobox templates]]</noinclude> | |}</includeonly><noinclude>{{doc}} | ||
[[Category:Infobox templates]]</noinclude> |
Latest revision as of 06:41, 11 December 2024
Template documentation
The {{CityInfobox}} is used to create an infobox for cities, towns, and similar administrative subdivisions. Use the CountryInfobox for countries and the RegionInfobox for subdivisions such as counties, provinces, districts, etc.
Usage
To use the template, copy and paste the following at the top of the article. Then add the appropriate parameter values.
{{CityInfobox | Short city name = | Full city name = | City Photos = | Photo description = | flag = | coa1 = | Locator Map = | country text = | country = | region = | foundation = | founded by = | government type = | government body = | leader title = | mayor = | elevation = | total area = | urban area = | metro area = | time zone = | population = | rank = | density = | demonym = }}
Parameters
Optional parameters are not displayed if left blank.
Parameter | Description | Type | Status | Notes |
---|---|---|---|---|
Short city name |
Short city name | String | Required | Defaults to the article pagename |
Full city name |
Full city name | String | Optional | Can be used for the city's native language name (for example, Москва for Moscow)
|
City Photos |
City image filename | String | Optional | |
Photo description |
Image caption | String | Optional | Will not display if City Photos has no value
|
flag |
City image flag filename | String | Optional | |
coa1 |
City coat of arms filename | String | Optional | |
Locator Map |
Locator map filename | String | Optional | |
country text |
Country name | String | Optional | Can be used to display a country name with a flag icon using {{flag}} |
country |
Country name | String | Required | Links to the country article; country text supersedes if it has a value
|
region |
Region | String | Optional | For example, district, county, province, state, etc. |
foundation |
Foundation date | String | Optional | |
founded by |
Founder's name(s) | String | Optional | |
government type |
Type of government | String | Optional | For example, Mayor-Council, Commission, etc. |
leader title |
Leader title | String | Optional | Defaults to Mayor |
mayor |
Leader's name | String | Optional | |
elevation |
Elevation above sea level | String | Optional | |
total area |
Total area | Numeric | Optional | Km2 |
urban area |
Urban area | Numeric | Optional | Km2 |
metro area | Metropolitan area | Numeric | Optional | Km2 |
time zone |
Time zone | String | Optional | |
population |
Population | Numeric | Optional | |
rank |
Population rank | String | Optional | |
density |
Population density | String | Optional | If total area and population have numeric values, the template will calculate the population density per km2. A value in density overrides the template's calculation.
|
demonym |
City residents demonym | String | Optional |
Non-numeric data for total area
and/or population
may result in a calculation error for density
. Please use numeric values for those parameters. Providing a parameter value for density
supersedes any calculation, however.
Examples
City of Example | |
---|---|
File:Cityphoto.png View of Example City from XYZ viewpoint | |
File:Exampleflag.png Flag |
File:Examplecoa1.png Coat of arms |
Location | |
File:Examplemap.png | |
Country | CountryName |
Region | RegionName |
Foundation | 01.01.1001 |
Founded by | FounderName |
Government | |
Type | Democratic |
Body | City Council |
Mayor | MayorName |
Physical | |
Elevation | 100 m |
Total area | 100 km2 |
Urban area | 80 km2 |
Metro area | 120 km2 |
Time zone | UTC+2 |
Population | |
Total | 1,000,000 |
Rank | 1st place |
Density | 10,000/km2 |
Demonym | Example Cityzen |
{{CityInfobox | Short city name = Example City | Full city name = City of Example | City Photos = cityphoto.png | Photo description = View of Example City from XYZ viewpoint | flag = exampleflag.png | coa1 = examplecoa1.png | Locator Map = examplemap.png | country = CountryName | region = RegionName | foundation = 01.01.1001 | founded by = FounderName | government type = Democratic | government body = City Council | leader title = Mayor | mayor = MayorName | elevation = 100 | total area = 100 | urban area = 80 | metro area = 120 | time zone = UTC+2 | population = 1,000,000 | rank = 1st place | density = 10,000 | demonym = Example Cityzen }}
City of Example | |
---|---|
File:Cityphoto.png View of Example City from XYZ viewpoint | |
File:Exampleflag.png Flag |
File:Examplecoa1.png Coat of arms |
Location | |
File:Examplemap.png | |
Country | CountryName |
Region | RegionName |
Foundation | 01.01.1001 |
Founded by | FounderName |
Government | |
Type | Democratic |
Body | City Council |
Mayor | MayorName |
Physical | |
Elevation | 100 m |
Total area | 100 km2 |
Urban area | 80 km2 |
Metro area | 120 km2 |
Time zone | UTC+2 |
Population | |
Total | 1,000,000 |
Rank | 1st place |
Density | 10,000/km2 |
Demonym | Example Cityzen |
{{CityInfobox | Short city name = Example City | Full city name = City of Example | City Photos = cityphoto.png | Photo description = View of Example City from XYZ viewpoint | flag = exampleflag.png | coa1 = examplecoa1.png | Locator Map = examplemap.png | country text = {{flag|CountryName}} | country = | region = RegionName | foundation = 01.01.1001 | founded by = FounderName | government type = Democratic | government body = City Council | leader title = Mayor | mayor = MayorName | elevation = 100 | total area = 100 | urban area = 80 | metro area = 120 | time zone = UTC+2 | population = 1,000,000 | rank = 1st place | density = | demonym = Example Cityzen }}
See also
- {{CountryInfobox}}
- {{RegionInfobox}}