Template:RegionInfobox/doc: Difference between revisions

From The World of Gotha
Jump to navigation Jump to search
(Created page with "<noinclude>{{docsub}}</noinclude> The <nowiki>{{</nowiki>RegionInfobox}} template provides an {{wp|Wikipedia:Manual of Style/Infoboxes|infobox}} for a geographic {{wp|region}} or country's {{wp|administrative division}}s. Typically a geo-political infobox, its natural geographic area counter part is <nowiki>{{</nowiki>GeoInfobox}}. ==Usage== To use the template, copy and paste the following code into the desired article page....")
 
m (Convert to Template:Code)
 
(One intermediate revision by the same user not shown)
Line 26: Line 26:
! width="125px" | Parameter !! width="150px" | Description !! Type !! Status !! Notes
! width="125px" | Parameter !! width="150px" | Description !! Type !! Status !! Notes
|-
|-
| <code>region name</code> || Region name || String || '''Required''' || Defaults to the article pagename
| {{code|region name}} || Region name || String || '''Required''' || Defaults to the article pagename
|-
|-
| <code>flag</code> || Flag image filename || String || Optional ||
| {{code|flag}} || Flag image filename || String || Optional ||
|-
|-
| <code>coa</code> || Coat of arms filename || String || Optional ||
| {{code|coa}} || Coat of arms filename || String || Optional ||
|-
|-
| <code>map</code> || Map filename || String || Optional ||
| {{code|map}} || Map filename || String || Optional ||
|-
|-
| <code>country</code> || Country location || String || Optional || Recommended: <code><nowiki>{{</nowiki>[[Template:Flag|flag]]|''countryname''}}</code>
| {{code|country}} || Country location || String || Optional || Recommended: <code><nowiki>{{</nowiki>[[Template:Flag|flag]]|''countryname''}}</code>
|-
|-
| <code>capital</code> || Capital || String || Optional ||
| {{code|capital}} || Capital || String || Optional ||
|-
|-
| <code>area</code> || Area size || Numeric || Optional || In square kilometers (km<sup>2</sup>)
| {{code|area}} || Area size || Numeric || Optional || In square kilometers (km<sup>2</sup>)
|-
|-
| <code>population</code> || Population || Numeric || Optional ||
| {{code|population}} || Population || Numeric || Optional ||
|-
|-
| <code>density</code> || Population density || Numeric || Optional || If <code>area</code> and <code>population</code> have numeric values, the template will calculate the population density per km<sup>2</sup>. A value in <code>density</code> supersedes the template's calculation.
| {{code|density}} || Population density || Numeric || Optional || If {{code|area}} and {{code|population}} have numeric values, the template will calculate the population density per km<sup>2</sup>. A value in {{code|density}} overrides the template's calculation.
|-
|-
| <code>demonym</code> || {{wp|Demonym}} || String || Optional ||
| {{code|demonym}} || {{wp|Demonym}} || String || Optional ||
|-
|-
| <code>timezone</code> || Time zone || String || Optional || Should be expressed as an offset from UTC (e.g., <code>UTC +3</code>)
| {{code|timezone}} || Time zone || String || Optional || Should be expressed as an offset from UTC (e.g., {{code|UTC +3}})
|-
|-
| <code>gdp</code> || {{wp|Gross domestic product}} || Numeric || Optional || If <code>population</code> and <code>gdp per capita</code> have numeric values, the template will calculate the region's total GDP. A value in <code>gdp</code> supersedes the template's calculation.
| {{code|gdp}} || {{wp|Gross domestic product}} || Numeric || Optional || If {{code||population}} and {{code|gdp per capita}} have numeric values, the template will calculate the region's total GDP. A value in {{code|gdp}} overrides the template's calculation.
|-
|-
| <code>gdp per capita</code> || {{wp|GDP}} per capita || Numeric || Optional || If <code>population</code> and <code>gdp</code> have numeric values, the template will calculate the GDP per capita. A value in <code>gdp per capita</code> supersedes the template's calculation.
| {{code|gdp per capita}} || {{wp|GDP}} per capita || Numeric || Optional || If {{code|population}} and {{code|gdp}} have numeric values, the template will calculate the GDP per capita. A value in {{code|gdp per capita}} supersedes the template's calculation.
|}
|}


Non-numeric data for <code>area</code>, <code>population</code>, <code>gdp</code>, and/or <code>gdp per capita</code> may result in calculation errors for <code>density</code>, <code>gdp</code>, and/or <code>gdp per capita</code>. Please use numeric values for those fields. Providing a parameter value supersedes any calculation, however. For example, using "25M" as a population figure results in the template not calculating density since "25M" is a non-numeric value. Also, providing a value for the <code>density</code> parameter, in this instance, supersedes the template's attempt to calculate a density value, so "25M" can display as the population and whatever value was provided for the <code>density</code> parameter will display in that field.
Non-numeric data for {{code|area}}, {{code|population}}, {{code|gdp}}, and/or {{code|gdp per capita}} may result in calculation errors for {{code|density}}, {{code|gdp}}, and/or {{code|gdp per capita}}. Please use numeric values for those fields. Providing a parameter value supersedes any calculation, however. For example, using "25M" as a population figure results in the template not calculating density since "25M" is a non-numeric value. Also, providing a value for the {{code|density}} parameter, in this instance, supersedes the template's attempt to calculate a density value, so "25M" can display as the population and whatever value was provided for the {{code|density}} parameter will display in that field.


Provided the <code>population</code> parameter has a numeric value, the template can calculate either <code>gdp</code> ''or'' <code>gdp per capita</code> provided one of those parameters has a numeric value. If <code>population</code> and <code>gdp</code> have numeric values, the template will calculate <code>gdp per capita</code>. If <code>population</code> and <code>gdp per capita</code> have numeric values, then the template will calculate <code>gdp</code>. Values provided for the <code>gdp</code> and/or <code>gdp per capita</code> supersede the template's calculations.
Provided the {{code|population}} parameter has a numeric value, the template can calculate either {{code|gdp}} ''or'' {{code|gdp per capita}} provided one of those parameters has a numeric value. If {{code|population}} and {{code|gdp}} have numeric values, the template will calculate {{code|gdp per capita}}. If {{code|population}} and {{code|gdp per capita}} have numeric values, then the template will calculate {{code|gdp}}. Values provided for the {{code|gdp}} and/or {{code|gdp per capita}} supersede the template's calculations.


==Example==
==Examples==
{{RegionInfobox
{{RegionInfobox
| Region name = Shaaniaah
| Region name = Shaaniaah

Latest revision as of 09:24, 13 November 2024

This is a documentation subpage for Template:RegionInfobox.
It may contain usage information, categories and other content that is not part of the original template page.

The {{RegionInfobox}} template provides an infobox for a geographic region or country's administrative divisions. Typically a geo-political infobox, its natural geographic area counter part is {{GeoInfobox}}.

Usage

To use the template, copy and paste the following code into the desired article page. Then add the appropriate parameter data.

{{RegionInfobox
| region name    =
| flag           =
| coa            =
| map            =
| country        =
| capital        =
| area           =
| population     =
| density        =
| demonym        =
| timezone       =
| gdp            =
| gdp per capita =
}}

Parameters

Optional parameters are not displayed if left blank.

Parameter Description Type Status Notes
region name Region name String Required Defaults to the article pagename
flag Flag image filename String Optional
coa Coat of arms filename String Optional
map Map filename String Optional
country Country location String Optional Recommended: {{flag|countryname}}
capital Capital String Optional
area Area size Numeric Optional In square kilometers (km2)
population Population Numeric Optional
density Population density Numeric Optional If 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 Demonym String Optional
timezone Time zone String Optional Should be expressed as an offset from UTC (e.g., UTC +3)
gdp Gross domestic product Numeric Optional If and gdp per capita have numeric values, the template will calculate the region's total GDP. A value in gdp overrides the template's calculation.
gdp per capita GDP per capita Numeric Optional If population and gdp have numeric values, the template will calculate the GDP per capita. A value in gdp per capita supersedes the template's calculation.

Non-numeric data for area, population, gdp, and/or gdp per capita may result in calculation errors for density, gdp, and/or gdp per capita. Please use numeric values for those fields. Providing a parameter value supersedes any calculation, however. For example, using "25M" as a population figure results in the template not calculating density since "25M" is a non-numeric value. Also, providing a value for the density parameter, in this instance, supersedes the template's attempt to calculate a density value, so "25M" can display as the population and whatever value was provided for the density parameter will display in that field.

Provided the population parameter has a numeric value, the template can calculate either gdp or gdp per capita provided one of those parameters has a numeric value. If population and gdp have numeric values, the template will calculate gdp per capita. If population and gdp per capita have numeric values, then the template will calculate gdp. Values provided for the gdp and/or gdp per capita supersede the template's calculations.

Examples

Shaaniaah

Country Sokoku
Capital Kin Haala
Area 220,859 km2
Population 11,858,501
Density 53.69/km2
Demonym Shaanian
Time zone UTC-10
GDP Expression error: Unexpected round operator.
GDP per capita Expression error: Unexpected / operator.
{{RegionInfobox
| Region name    = Shaaniaah
| flag           = Flag_shaaniaah.png
| coa            = CoA_shaaniaah.png
| map            = Map_shaaniaah.png
| country        = {{flag|Sokoku}}
| capital        = Kin Haala
| area           = 220,859
| population     = 11,858,501
| density        =
| demonym        = Shaanian
| timezone       = UTC-10
| gdp            =
| gdp per capita =
}}


Giondo

[[File:{{{map}}}|150px]]
Country Nestor
Capital Giondo City
Area 1000 km2
Population 6,741,662
Density 6,741.66/km2
Demonym Gion
Time zone UTC-5
GDP 171,633,472,183
GDP per capita 25,459
{{RegionInfobox
|Region name    = Giondo
|country        = {{flag|Nestor}}
|capital        = Giondo City
|area           = 1000
|population     = 6,741,662
|density        =
|demonym        = Gion
|timezone       = UTC-5
|gdp            = 171,633,472,183
|gdp per capita =
}}

See also