Difference between revisions of "Template:Columns"
Jump to navigation
Jump to search
m (Protected "Template:Columns": protecting as it will (eventually) be included on to a lot of pages (and I get really paranoid about templates like that that aren't protected 8-) ) ([Edit=Allow only administrators] (indefinite) [Move=Allow only administ) |
(added option to override sorting - |sort=none will make it list items in the order you give it to them) |
||
Line 1: | Line 1: | ||
{{#arraydefine:list|{{{1}}}|* | {{#arraydefine:list|{{{1}}}|* | ||
|sort=asc}}{{#arrayunique:list}}{{#arrayslice:notcol1|list|{{#expr: ceil({{#arraysize:list}} / 3)}}}}{{#arraydiff:col1|list|notcol1}}{{#arrayslice:col3|notcol1|{{#expr: {{#arraysize:notcol1}} / 2 round 0}}}}{{#arraydiff:col2|notcol1|col3}}{{#arrayslice:column2|list|{{#expr: {{#arraysize:list}} / 3 round 0}}}}{{#arrayslice:column3|column1|{{#expr: 2 * ({{#arraysize:list}} / 3) round 0}}}}{| {{{options|style="margin:0 auto;"}}} | |sort={{{sort|asc}}}}}{{#arrayunique:list}}{{#arrayslice:notcol1|list|{{#expr: ceil({{#arraysize:list}} / 3)}}}}{{#arraydiff:col1|list|notcol1}}{{#arrayslice:col3|notcol1|{{#expr: {{#arraysize:notcol1}} / 2 round 0}}}}{{#arraydiff:col2|notcol1|col3}}{{#arrayslice:column2|list|{{#expr: {{#arraysize:list}} / 3 round 0}}}}{{#arrayslice:column3|column1|{{#expr: 2 * ({{#arraysize:list}} / 3) round 0}}}}{| {{{options|style="margin:0 auto;"}}} | ||
{{#ifeq: {{#arraysize:col1}} | 0 | | {{!}}style="vertical-align:top;"{{!}} | {{#ifeq: {{#arraysize:col1}} | 0 | | {{!}}style="vertical-align:top;"{{!}} | ||
<ul><li>{{#arrayprint:col1|</li><li>}}</li></ul>}} | <ul><li>{{#arrayprint:col1|</li><li>}}</li></ul>}} |
Revision as of 23:21, 22 October 2014
|