Jump to content

Template:Populationof/doc

From Wikivoyage

Template {{populationof}} is used in destination articles to output text stating the population of that location, using data extracted from Wikidata. Using this template, rather than simple text, provides an easier method of identifying pages with population statements with the intention of keeping numbers more up to date.

Basic usage

[edit]

With no input, the template will automatically find the Wikidata item for the article, retrieve the population, and output a suitable sentence along with a Wikidata link icon ("edit wikidata").

For example, placing the template on page Metro Cebu without any parameters will give:

CodeOutput
{{populationof}}It is home to about 2.8 million people (census, 1 August 2015) "edit wikidata"

This template does not include a sentence-ending period, so it should be followed by a period to make a complete sentence, or an optional comma and the rest of the sentence.

CodeOutput
{{populationof}}.It is home to about 2.8 million people (census, 1 August 2015) "edit wikidata".
{{populationof}} and is the second-largest urban area in the Philippines.It is home to about 2.8 million people (census, 1 August 2015) "edit wikidata" and is the second-largest urban area in the Philippines.

Advanced usage

[edit]

If set, |pop= will output "population of" and the pop number given. You can also set |year= to include the year of the census or |text= to use custom text. (If both are provided, |text= will be used and |year= will be ignored.)

CodeOutput
{{populationof|pop=123456}}population of 123456
{{populationof|pop=123456|year=2021}}As of 2021 population was 123456
{{populationof|text=It's believed that [[North Sentinel Island]] has a population as high as|pop=400}}It's believed that North Sentinel Island has a population as high as 400

If set, |qwd= will use data from the Wikidata item qwd, rather than the article's linked Wikidata item.

CodeOutput
{{populationof|qwd=Q574903}}It is home to about 498,000 people (census, 1 May 2020) "edit wikidata"