User:Mathglot/sandbox/Templates/Alberta templates/Cpmr13/doc

Generates a single wikitable row with thirteen cells containing data about one Canadian municipality.

Parameters
This template has twelve required positional parameters with named aliases, and four optional named parameters (sample values are for Banff):

Positional: 1 or loc – municipality (e.g., 'Banff')

2 or type – municipality type (e.g., 'Town'; others include: 'City', 'Village', 'Summer village')

3 or reg – region (e.g., 'Alberta's Rockies')

4 or cdiv – census division (e.g., '15')

5 or rn – rural neighbouring municipality (e.g., Improvement District No. 9 (Banff))

6 or inc – incorporation date (e.g., 'January 1, 1990')

7 or csiz – number of councillors (a number; e.g., '7')

8 or mpop – latest population from the most recent municipal census, if any (no punct.; e.g., '8875')

9 or mpy – municipal population census year, if any (e.g., '2017')

10 or pop2 – latest population from national census (no punct.; e.g., '7851')

11 or pop1 – previous population from national census (no punct.; e.g., '7584')

12 or area – area (in km sq., with decimal point as needed; e.g., '4.77')

Optional:

These three parameters modify the target article or display string in the column one link (see 'Name' in below) prov – province (default: 'Alberta')

comm-link – replaces the target article for the municipality

suffix – appends an unlinked text string to the linked municipality name in column one (see below)

This parameter links this row to any citations present for it in the references section.


 * r – If this row has citations, place the name of the named reference that holds the citation(s). The name can be found in Draft:Cpmrefs and is usually the name of the municipality, less any embedded blanks, e.g.: HayLake.

If any positional param is used, such as the first unnamed param for the municipality name, then all twelve must be used positionally. I.e., you can't use loc for municipality, and then switch to positional param '2' for 'type' and the others. Either all positional, or all named.

Any or all of the four optional parameters may be used regardless whether positional, or named parameters are used for the first twelve.

Table cells
The template generates a single wikitable row with thirteen columns. The content of the cells in the table row are a function of the parameters, mostly a copy (or a formatted copy) of a parameter, sometimes a function of multiple parameters. The content of the cells, in left-to-right column order are (sample values are from Airdrie, Alberta):
 * 1) Name  – the linked name of the municipality, plus any unlinked suffix. Made up of the required loc (or alias param 1), and the province (from prov) linked by default as: MunicipalityName +  + ProvinceName and piped to the municipality name; e.g., ' Airdrie '). May be modified using comm-link and suffix.
 * 2) Status – whether the municipality is a city, town, village, summer village, and so on. A copy of type; e.g., 'City'.
 * 3) Region – see Regions of Alberta; from reg, and linked to the region article, piped as needed; e.g., Calgary Metro . If the term 'Metropolitan Region' is the last part of the name, it is abbreviated to 'Metro'.
 * 4) CD – Census division – from cdiv and linked to the division article, e.g. 6
 * 5) Rural neighbour – from rn and linked, e.g. Rocky View County
 * 6) Incorporation date – from inc (e.g. 'January 1, 1985')
 * 7) Councillors – from csiz (e.g. '7')
 * 8) Municipal census pop. and year – from mpop and mpy, e.g., '70,564 (2019)'; empty for municipalities that do not have a recent municipal census count. Be mindful of WP:CANPOP.
 * 9) Population (year) – the recent population figure (default year: ); formatted copy of param pop2.
 * 10) Population (year) – older population figure for recent growth comparison (default year: ); formatted copy of param pop1.
 * 11) Change – change in population; a positive value indicates rising population; calculated from pop2 and pop1.
 * 12) Land area km2 – area of the municipality in square kilometres; copied from area.
 * 13) Population density km2 – population density in square kilometres; calculated from pop2 and area parameters.

Example
