Permanently protected template

Template:Endorsements box: Difference between revisions

Jump to navigation Jump to search
(um no. this needs to be collapsible, which is fully compliant with access. per talk)
 
Line 1: Line 1:
<templatestyles src="Endorsements box/styles.css"/><div class="endorsements-box" {{#if:{{{width|}}}|style="width: {{{width}}}"}}><!--
+
<templatestyles src="Endorsements box/styles.css"/><div class="endorsements-box mw-collapsible" {{#if:{{{width|}}}|style="width: {{{width}}}"}}><!--
 
--><div class="endorsements-box-title" {{#if:{{{color|}}}|style="color: {{{color}}}"}}>{{{title|List of political endorsements}}}</div><!--
 
--><div class="endorsements-box-title" {{#if:{{{color|}}}|style="color: {{{color}}}"}}>{{{title|List of political endorsements}}}</div><!--
--><div class="endorsements-box-list mw-collapsible {{#if:{{{columns|}}}{{{colwidth|}}}|endorsements-box-list-columns}}" {{#if:{{{colwidth|}}}|style="column-width: {{{colwidth}}};"}}>
+
--><div class="endorsements-box-list mw-collapsible-content {{#if:{{{columns|}}}{{{colwidth|}}}|endorsements-box-list-columns}}" {{#if:{{{colwidth|}}}|style="column-width: {{{colwidth}}};"}}>
 
{{{list}}}
 
{{{list}}}
 
</div></div><noinclude>
 
</div></div><noinclude>

Latest revision as of 03:45, 11 May 2021

List of political endorsements

{{{list}}}

Template documentation[view] [edit] [history] [purge]

This template generates a framed box for use in listing political endorsements (see example below). The generated box is collapsible, but initally presented uncollapsed (per our MoS).

Sophie Kandidatin


Usage

This template outputs a framed box with table-like background coloring for use in listing political endorsements. The kind of listing, e.g. bulleted lists, numbered lists, etc., (and, in fact, all of the content) is up to the editor's discretion, although bullet lists are presumed to be the preferred format. Images, prose text, wikiheadings, etc., are all technically supported, but users should keep community usage consensus in mind when filling the list parameter. In particular, <small></small> and {{small}} should not be used, per MOS:SMALL, as the template outputs text at 88% of the base font size, so it's already rather, well, small.

All field names used must be in lowercase.

You can copy a blank version to use. Remember to use the "|" (pipe) character between each field. Please delete any unused fields to avoid clutter in the edit window.

The template has the following syntax:

Fields

All parameters are optional, although without list, the template is rather silly and produces either an empty box or merely {{{list}}}.

  • title: Candidate name; appears in the title bar of the generated box. If not present, "List of political endorsements" is displayed.
  • color: Color of title text. Can be any recognized definition, such as HTML names (e.g., "red", "LightGreen"), hex color codes (e.g., "#FF0000", "#90ee90") or RGB Decimal (e.g., "rgb(255, 0, 0)", "rgb(144, 238, 144)"). Note that the background color is already a medium gray; many foreground colors will be hard to discern.
  • columns: When non-empty, causes contents of list to be formatted into columns of 20em width, unless colwidth is set (in which case, columns is ignored)
  • colwidth: Width into which contents of list should be formatted, overriding presence or value of columns (a valid value here always causes columns). Units not required, e.g., em, px, or %, but em units (e.g., "30em") are recommended.
  • width: Settable (approximate) width of entire box; defaults to 100%. Units required, e.g., em, px, or %. Careless setting of this parameter can cause box to overrun available display width.
  • list: List of parties (i.e., individuals, groups, companies, etc.) endorsing the candidacy. Reference citations are expected (just as with prose additions).

Examples

Without columns

{{Endorsements box
| title = Example without columns
| list =
* Item 1
* Item 2
}}
Example without columns
  • Item 1
  • Item 2

With columns

Any value in the |columns= parameter will create a list with column widths of 20em (although the |colwidth= parameter can override this).

{{Endorsements box
| title = Example with columns
| columns = yes
| list =
* Item 1
* Item 2
* Item 3
* Item 4
}}
Example with columns
  • Item 1
  • Item 2
  • Item 3
  • Item 4

With color and other column widths

A color can be set for the title bar text (ordinarily the candidate's name). The |colwidth= parameter causes columns to be used at the specified width.

{{Endorsements box
| title = Example with color and wider columns
| color = darkorange
| colwidth = 29em
| list =
* Item 1
* Item 2
* Item 3
* Item 4
}}
Example with color and wider columns
  • Item 1
  • Item 2
  • Item 3
  • Item 4

With color and constrained width

A color can be set for the title bar text (ordinarily the candidate's name). The |colwidth= parameter causes columns to be used at the specified width.

{{Endorsements box
| title = Example with color and constrained width
| color = #3366CC
| width = 40%
| list =
* Item 1
* Item 2
* Item 3
* Item 4
}}
Example with color and constrained width
  • Item 1
  • Item 2
  • Item 3
  • Item 4


References