Template:Political party/doc
| This is a documentation subpage for Template:Political party. It may contain usage information, categories and other content that is not part of the original template page. |
This template is designed to make it easier to read tables where the name of a political party appears as one of the columns.
Rather than a table where party names appear on a background colour, which can provide poor accessibility, this template creates two columns, one with a coloured bar and one with the party name, both populated from the political party metadata subtemplates (e.g. Template:Conservative Party (UK)/meta/color and Template:Conservative Party (UK)/meta/shortname, or Template:Democratic Party (US)/meta/color and Template:Democratic Party (US)/meta/shortname).
This means that a table can be generated looking like this:
| Information | Party | Notes | |
|---|---|---|---|
| Some information | style="background-color: Template:Union for a Popular Movement/meta/color; width: 3px;" | | [[Union for a Popular Movement|Template:Union for a Popular Movement/meta/shortname]] | Some notes would go here, these will often be rather longer than the contents of the other columns |
| More information | style="background-color: Template:Republican Party (US)/meta/color; width: 3px;" | | [[Republican Party (US)|Template:Republican Party (US)/meta/shortname]] | Some more notes. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero sapien. |
| And yet more | Green | Praesent at magna eget nulla dignissim gravida vitae quis ante. Phasellus turpis velit, accumsan sed facilisis in. | |
Usage
This template creates two columns (one with the colour, one with the name), so the table header should be colspanned appropriately. The table above was generated as follows:
{| class="wikitable"
! Information
! colspan="2" | Party
! Notes
|-
! Some information
{{Political party|Union for a Popular Movement}}
| Some notes would go here, these will often be rather longer than the contents of the other columns
|-
! More information
{{Political party|Republican Party}}
| Some more notes. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero sapien.
|-
! And yet more
{{Political party|Green Party of England and Wales}}
| Praesent at magna eget nulla dignissim gravida vitae quis ante. Phasellus turpis velit, accumsan sed facilisis in.
|}
See also
- Wikipedia:WikiProject Politics/Political parties