www.fgks.org   »   [go: up one dir, main page]

Jump to content

Template:Canadian party colour/doc

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Arctic.gnome (talk | contribs) at 18:41, 26 May 2015 (update). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

This template can be used to standardize the colours used to represent Canadian political parties in tables, lists, and templates. Enter the jurisdiction and party name, and this template will produce the hex colour code for that party. In tables, this template can start a new row with one cell containing the colour and the next cell containing a wikilink to the article about that party.

A full list of available party names is at Wikipedia:WikiProject Political parties and politicians in Canada/list of parties.

Usage

  • {{Canadian party colour|Jur.|Party}} to get just the hex code (for use inside other templates)
  • {{Canadian party colour|Jur.|Party|background}} to get bgcolor="colour"
  • {{Canadian party colour|Jur.|Party|nohash}} to get the colour without the leading #
  • {{Canadian party colour|Jur.|Party|name}} to get a wikilink to the party's article
  • {{Canadian party colour|Jur.|Party|name|short}} to get a shortened wikilink to party's article (for use in tables)
  • {{Canadian party colour|Jur.|Party|colour&name}} to get an inline text version of the party colour followed by a wikilink to the party's article
  • {{Canadian party colour|Jur.|Party|colour&name|short}} to get an inline text version of the party colour followed by a shortened wikilink to the party's article
  • {{Canadian party colour|Jur.|Party|row}} to start a new row with party colour as the first cell
  • {{Canadian party colour|Jur.|Party|row-name}} to start a new row with the party colour as the first cell and a wikilink to the party's article as the second cell
  • {{Canadian party colour|Jur.|Party|row-name|short}} to start a new row with the party colour as the first cell and a shortened wikilink to the party's article as the second cell

Where Jur. is the jurisdiction, being one of: CA, AB, BC, MB, NB, NS, NF, NL, NT, NU, ON, PE, QC, SK, YK, YT, EDM, MTL, VAN

Example

{|class="wikitable"
{{Canadian party colour|CA|NDP|row-name}}
{{Canadian party colour|BC|Liberal|row-name}}
{{Canadian party colour|MB|CoR|row-name}}
{{Canadian party colour|MB|CoR|row-name|short}}
{{Canadian party colour|CA|PC|row}}
|Example text. Example text. Example text. Example text.
{{Canadian party colour|NL|Independent|row-name}}
|-
|{{Canadian party colour|CA|Other|background}} rowspan=2|
|{{Canadian party colour|XX|Liberal|background}}|This cell uses "XX" for jurisdiction. Invalid jurisdictions (or jurisdictions where that party does not exist) will sometimes find a default colour.
|-
|{{Canadian party colour|ON|Invalid text|background}}|This cell uses "Invalid text" as the party name. Invalid party names will default to the independent colour and will use the exact text entered when using the "row-name" function.
|}

Will produce:

New Democratic
Liberal
Confederation of Regions
Conf of Regions
  Example text. Example text. Example text. Example text.
Independent
This cell uses "XX" for jurisdiction. Invalid jurisdictions (or jurisdictions where that party does not exist) will sometimes find a default colour.
This cell uses "Invalid text" as the party name. Invalid party names will default to the independent colour and will use the exact text entered when using the "row-name" function.

Replacement of old templates

This template is intended to supersede, and simplify, the existing methods of generating party colours, which use a series of at least 769 different templates (down to -10 as of June 29, 2024):

  1. Template:Canadian politics/party colours and /meta/color templates, including
    1. 453 federal and other province subtemplates (now down to -10)
    2. 34 Alberta subtemplates (now all replaced)
    3. 38 Edmonton subtemplates (now all replaced), and
    4. 8 Montreal subtemplates (now all replaced);
  2. political party election (or "row-name") templates, including
    1. 111 federal subtemplates (now all replaced) and
    2. 23 Ontario subtemplates (now all replaced);
  3. 102 /meta/shortname subtemplates (now all replaced).