Template:Population WD/doc: Difference between revisions
No edit summary |
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]]. If no argument is provided, it will show the population size of the current article subject, otherwise of the article title stated in the first unnamed parameter. It also works if the article is moved, |
Shows the most recent population size of a place, according to [[WP:Wikidata|Wikidata]]. If no argument is provided, it will show the population size of the current article subject, otherwise of the article title stated in the first unnamed parameter. It also works if the article is moved, since it follows the redirection. |
||
A purpose of this 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 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 21:38, 26 February 2022
This is a documentation subpage for Template:Population WD. It may contain usage information, categories and other content that is not part of the original template page. |
Shows the most recent population size of a place, according to Wikidata. If no argument is provided, it will show the population size of the current article subject, otherwise of the article title stated in the first unnamed parameter. It also works if the article is moved, since it follows the redirection.
A purpose of this 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
Example:
{{population WD}}
shows the population of the current article subject.
These two places have the same Wikidata label Stockholm:
{{population WD|Stockholm}}
gives the population of Stockholm: 984,748 (evaluation, 2022) .
{{population WD|Stockholm (town), Wisconsin}}
gives the population of Stockholm (town), Wisconsin: 218 (census, 2020 United States Census, 2020) .
The redirection page Stockholm, Sweden also works:
{{population WD|Stockholm, Sweden}}
and gives: 984,748 (evaluation, 2022) .
A last option is to use the qid code of Stockholm (Q1754), which however makes the wikicode less comprehensible:
{{population WD|qid=q1754}}
results in: 984,748 (evaluation, 2022) .