(Go: >> BACK << -|- >> HOME <<)

Jump to content

Template:Population WD/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
Shows the most recent population size of a place, according to [[WP:Wikidata|Wikidata]]. It will show the population size of the ''article title'' subject stated in the first unnamed parameter (it does ''not'' use the Wikidata label). It also works if the article is moved, since it follows the redirection. If no argument is provided, it shows the population of the current article subject.
Shows the most recent population size of a place, according to [[WP:Wikidata|Wikidata]], together with the year.
{{tlr|Population WD|<page title>}} shows the population size of the ''page title'' subject stated in the first unnamed parameter (it does ''not'' use the Wikidata label). It also works if the article is moved, since it follows the redirection.
{{tlr|Population WD}} without argument, shows the population of the current article subject.


A purpose of this kind of template is to avoid advanced code in Wikipedia articles, and use a comprehensible property name and article title instead of pid and qid codes. However, the template may also be called with a parameter named ''qid''. It may for example be used in population tables.
A purpose of this kind of template is to avoid advanced code in Wikipedia articles, and use a comprehensible property name and article title instead of pid and qid codes. However, the template may also be called with a parameter named ''qid''. It may for example be used in population tables.

Revision as of 00:04, 27 February 2022

Shows the most recent population size of a place, according to Wikidata, together with the year.

Lua error in Module:Shortcut at line 45: attempt to index local 'titleObj' (a nil value). shows the population size of the page title subject stated in the first unnamed parameter (it does not use the Wikidata label). It also works if the article is moved, since it follows the redirection.

without argument, shows the population of the current article subject.

A purpose of this kind of template is to avoid advanced code in Wikipedia articles, and use a comprehensible property name and article title instead of pid and qid codes. However, the template may also be called with a parameter named qid. It may for example be used in population tables.

Usage

Current page

Example:

{{population WD}}

shows the population of the current article subject.

Articles sharing the same label

The template does not use the Wikidata label. These two places have the same label Stockholm:

{{population WD|Stockholm}}

gives the population of Stockholm: 984,748 (evaluation, 2022) Edit this on Wikidata.

{{population WD|Stockholm (town), Wisconsin}}

gives the population of Stockholm (town), Wisconsin: 218 (census, 2020 United States Census, 2020) Edit this on Wikidata.

Redirections

The redirection page Stockholm, Sweden also works:

{{population WD|Stockholm, Sweden}}

and gives: 984,748 (evaluation, 2022) Edit this on Wikidata.

Qid code

A last option is to use the qid code of Stockholm (Q1754), which however makes the wikicode less comprehensible:

{{population WD|qid=q1754}}

resulting in 984,748 (evaluation, 2022) Edit this on Wikidata.

See also