Columns – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
(Template creation)
 
(Replace shrink parameter with expand parameter)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}
<includeonly>{{#if:{{{1|}}}
| {{#if:{{{2|}}}
| {{#if:{{{2|}}}
| <div style="columns: {{{1|2}}}">{{{2|}}}</div>
| {{#if:{{{3|{{{expand|}}}}}}||<div>}}<div class="columns" style="column-count: {{{1|2}}}{{#if:{{{3|{{{expand|}}}}}}||; display: inline-block}}">{{{2|}}}</div>{{#if:{{{3|{{{expand|}}}}}}||</div>}}
| -no columns content defined-
| -no columns content defined-{{TemplateCase||[[Category:Columns template usage error]]}}
}}
}}
| -no columns count defined-
| -no columns count defined-{{TemplateCase||[[Category:Columns template usage error]]}}
}}</includeonly><noinclude>{{Doc/Template
}}</includeonly><noinclude>{{Doc/Template
|descr= Creates CSS columns.
|descr= Creates CSS columns. It also adds the page to the [[:Category:Columns template usage error|Columns template usage error]] category on usage error.
|param1= cols
|param1= cols
|descr1= number of columns
|descr1= number of columns
|param2= content
|param2= content
|descr2= to be split in columns
|descr2= to be split in columns, usually a list
|param3= expand
|descr3= named parameter. makes the columns take the whole width
|example1= <nowiki>{{Columns}}</nowiki>
|example1= <nowiki>{{Columns}}</nowiki>
|result1= {{Columns}}
|result1= {{Columns}}
Line 27: Line 29:
* contentD
* contentD
}}
}}
|example4= <div style="white-space: pre"><nowiki>{{Columns|3|
|example4= <div style="white-space: pre"><nowiki>{{Columns|2|
* contentA
* contentA
* contentB
* contentB
Line 33: Line 35:
* contentD
* contentD
}}</nowiki></div>
}}</nowiki></div>
|result4= {{Columns|3|
|result4= {{Columns|2|
* contentA
* contentA
* contentB
* contentB
Line 39: Line 41:
* contentD
* contentD
}}
}}
|example5= <div style="white-space: pre"><nowiki>{{Columns|3|
* contentA
* contentB
* contentC
* contentD
}}</nowiki></div>
|result5= {{Columns|3|
* contentA
* contentB
* contentC
* contentD
}}
|example6= <div style="white-space: pre"><nowiki>{{Columns|4|
* contentA
* contentB
* contentC
* contentD
}}</nowiki></div>
|result6= {{Columns|4|
* contentA
* contentB
* contentC
* contentD
}}
|example7= <div style="white-space: pre"><nowiki>Above{{Columns|3|
* contentA
* contentB
* contentC
* contentD
|expand= y
}}Below</nowiki></div>
|result7= <div style="min-width: 50em">Above{{Columns|3|
* contentA
* contentB
* contentC
* contentD
|expand= y
}}Below</div>
}}</noinclude>
}}</noinclude>

Latest revision as of 14:41, 22 May 2022

Creates CSS columns. It also adds the page to the Columns template usage error category on usage error.

This template is used on these pages.

Usage

{{Columns|cols|content|expand}}

  • cols: number of columns
  • content: to be split in columns, usually a list
  • expand: named parameter. makes the columns take the whole width
Examples
Code Result
{{Columns}} -no columns count defined-
{{Columns|3}} -no columns content defined-
{{Columns|| * contentA * contentB * contentC * contentD }}
-no columns count defined-
{{Columns|2| * contentA * contentB * contentC * contentD }}
  • contentA
  • contentB
  • contentC
  • contentD
{{Columns|3| * contentA * contentB * contentC * contentD }}
  • contentA
  • contentB
  • contentC
  • contentD
{{Columns|4| * contentA * contentB * contentC * contentD }}
  • contentA
  • contentB
  • contentC
  • contentD
Above{{Columns|3| * contentA * contentB * contentC * contentD |expand= y }}Below
Above
  • contentA
  • contentB
  • contentC
  • contentD
Below