Difference between revisions of "Template:Columns/doc"

From WikiCorporates
Jump to navigation Jump to search
m (→‎Example)
 
(45 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
__NOTOC__
 +
<small>[[Template:Columns|<< Template:Columns]]</small>
 
=== Usage ===
 
=== Usage ===
−
Use this template to create a flexible, multi-column list.<br/>
+
Use this template to create a flexible, multi-column list, optionally with [[Template:Cols link]].<br/>
−
If used without parameters, it will produce a flexible, multi-column, 20em column-width list, with a list-style-type of disc, and a font-size of 100%. See more List-style-type options at [https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type Moz. Dev. Network].<br/>
+
If used without parameters, it will produce a flexible, multi-column, 20em column-width list, with an unordered list-style-type of disc, and a font-size of 100%.
−
See [[Foreign Policy Centre#Connections|Foreign Policy Centre]] "Partners and Members" for an in-use example.
 
  
−
The parameters are:
+
Mozilla Dev. Networks has 3 useful pages on this:
 +
* [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul ul options]
 +
* [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol ol options]
 +
* [https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type css options]
 +
 
 +
The parameters are (see also [[MediaWiki:Common.css]]):
 
<pre>
 
<pre>
−
{{{width}}}   - default = 20em
+
width  - default = 20em
−
{{{fsize}}}   - default = 100%
+
fsize  - default = 100%
−
{{{lst}}}     - default = disc (options: [none|disc|circle|square|decimal])
+
type    - default  = ul;  options: [ol | ul]
−
{{{content}}} - whatever content you want to put in here.
+
lst    - default for ul = disc; options: [none|disc|circle|square]
 +
          default for ol = decimal;  options: [ ...todo... ]
 +
rule    - optional vertical rule between columns
 +
class  - vspace  = sets the line-height to 1.8em instead of the default 1.6em
 +
        - timeline = removes the bullet, left-aligns the content.
 +
content - whatever content you want to put in here.
 
</pre>
 
</pre>
  
−
=== Example ===
+
=== Examples ===
−
Note the use of the <code><nowiki>{{columnsHdr|Board Members}}</nowiki></code> template to create a heading.
+
Note the use of the <code><nowiki>{{Cols hdr|Board Members}}</nowiki></code> template to create a heading: [[Template:Cols hdr]]<br/>
 +
Also note the use of the <code><nowiki>{{Cols note|&dagger; 100% fake}}</nowiki></code> template to create a note:
 +
[[Template:Cols note]]
 +
 
 +
==== Eg. #1: Plain Vanilla ====
 +
* [[Foreign Policy Centre#Connections|Foreign Policy Centre]] "Partners and Members"
 +
* [[Conservatives for Britain]]
 
<pre>
 
<pre>
−
{{columns|width=15em|lst=square|content=
+
{{Columns|width=20em|lst=square|rule=1|content=
−
{{columnsHdr|Board Members}}
+
{{Cols hdr|Board Members}}
−
<li>Nigel Lawson, President</li>
+
<li>[[Nigel Lawson]], President</li>
−
<li>David Campbell Bannerman, Co-Chair</li>
+
<li>[[David Campbell Bannerman]]</li>
−
<li>Steve Baker, Co-Chair</li>
+
<li>&dagger; [[Steve Baker]], Co-Chair </li>
 +
<li>[[Gerald Howarth|Sir Gerald Howarth]]</li>
 +
<li>[[Michelin]] [[File:Michelin-Group-horiz.svg|105x20px|right]]</li>
 
... ...
 
... ...
 +
{{Cols note|&dagger; Member of the [[ERG]].}}
 
}}
 
}}
 
</pre>
 
</pre>
−
{{columns|width=15em|lst=square|content=
+
{{Columns|width=20em|lst=square|rule=1|content=
−
<li style="list-style-type:none; font-weight:bold; margin-left:-1.2em;">Board Members</li>
+
{{Cols hdr|Board Members}}
−
<li>Nigel Lawson, President</li>
+
<li>[[Nigel Lawson]], President</li>
−
<li>David Campbell Bannerman</li>
+
<li>[[David Campbell Bannerman]]</li>
−
<li>Steve Baker, Co-Chair</li>
+
<li>&dagger; [[Steve Baker]], Co-Chair </li>
−
<li>Michael Ancram</li>
+
<li>[[Michelin]] [[File:Michelin-Group-horiz.svg|105x20px|right]]</li>
−
<li>David Campbell Bannerman</li>
 
 
<li>Steve Bell</li>
 
<li>Steve Bell</li>
−
<li>Lord Blencathra</li>
 
−
<li>Bill Cash</li>
 
−
<li>Howard Flight</li>
 
 
<li>Lord Forsyth</li>
 
<li>Lord Forsyth</li>
 
<li>Liam Fox</li>
 
<li>Liam Fox</li>
−
<li>Lord Hamilton</li>
 
−
<li>Daniel Hannan</li>
 
 
<li>Greville Howard</li>
 
<li>Greville Howard</li>
−
<li>Sir Gerald Howarth</li>
+
<li>[[Gerald Howarth|Sir Gerald Howarth]]</li>
 +
{{Cols note|&dagger; Member of the [[ERG]].}}
 +
}}
 +
 
 +
==== Eg. #2: Timeline ====
 +
Example: [[Patrick Minford]]
 +
<pre>
 +
{{Columns|width=30em|lst=none|class=timeline|content=
 +
{{Cols tline|Apr.2016|Co-founded {{em|Economists for Brexit}}, now morphed into [[Economists for Free Trade]].|png=Economists-for-Free-Trade.png|w=81|h=25}}
 +
{{Cols tline|&nbsp;|Council, [[Centre for Policy Studies]].|png=Centre-for-Policy-Studies-opt.svg|w=25|h=25}}
 +
{{Cols tline|2011-|Advisory Council, [[Reform]]|png=Reform-opt.svg|w=31|h=25}}
 +
... ...
 +
}}
 +
</pre>
 +
 
 +
{{Columns|width=30em|lst=none|class=timeline|content=
 +
{{Cols tline|Apr.2016|Co-founded {{em|Economists for Brexit}}, now morphed into [[Economists for Free Trade]].|png=Economists-for-Free-Trade.png|w=81|h=25}}
 +
{{Cols tline|&nbsp;|Council, [[Centre for Policy Studies]].|png=Centre-for-Policy-Studies.svg|w=25|h=25}}
 +
{{Cols tline|2011-|Advisory Council, [[Reform]]|png=Reform-Research-Trust.svg|w=31|h=25}}
 
}}
 
}}
−
<includeonly>[[Category:WikiPolitiks templates]]</includeonly>
+
<includeonly>[[Category:WikiCorporates templates]]</includeonly>

Latest revision as of 13:28, 30 May 2020

<< Template:Columns

Usage

Use this template to create a flexible, multi-column list, optionally with Template:Cols link.
If used without parameters, it will produce a flexible, multi-column, 20em column-width list, with an unordered list-style-type of disc, and a font-size of 100%.

Mozilla Dev. Networks has 3 useful pages on this:

The parameters are (see also MediaWiki:Common.css):

width   - default  = 20em
fsize   - default  = 100%
type    - default  = ul;   options: [ol | ul]
lst     - default for ul = disc; options: [none|disc|circle|square]
          default for ol = decimal;  options: [ ...todo... ]
rule    - optional vertical rule between columns
class   - vspace   = sets the line-height to 1.8em instead of the default 1.6em
        - timeline = removes the bullet, left-aligns the content.
content - whatever content you want to put in here.

Examples

Note the use of the {{Cols hdr|Board Members}} template to create a heading: Template:Cols hdr
Also note the use of the {{Cols note|† 100% fake}} template to create a note: Template:Cols note

Eg. #1: Plain Vanilla

{{Columns|width=20em|lst=square|rule=1|content=
{{Cols hdr|Board Members}}
<li>[[Nigel Lawson]], President</li>
<li>[[David Campbell Bannerman]]</li>
<li>† [[Steve Baker]], Co-Chair </li>
<li>[[Gerald Howarth|Sir Gerald Howarth]]</li>
<li>[[Michelin]] [[File:Michelin-Group-horiz.svg|105x20px|right]]</li>
... ...
{{Cols note|† Member of the [[ERG]].}}
}}

Eg. #2: Timeline

Example: Patrick Minford

{{Columns|width=30em|lst=none|class=timeline|content=
{{Cols tline|Apr.2016|Co-founded {{em|Economists for Brexit}}, now morphed into [[Economists for Free Trade]].|png=Economists-for-Free-Trade.png|w=81|h=25}}
{{Cols tline| |Council, [[Centre for Policy Studies]].|png=Centre-for-Policy-Studies-opt.svg|w=25|h=25}}
{{Cols tline|2011-|Advisory Council, [[Reform]]|png=Reform-opt.svg|w=31|h=25}}
... ...
}}