User:Ferretwings/version history row

{{#vardefine:all-platform|{{#var:all-{{#if:{{#pos:{{PAGE}}|Console}}|console|mobile}}}}

{{#vardefine:row|{{{platform|}}}{{{version|}}}{{{build|}}}}} {{#vardefine:row:mainanchor:{{{version|}}}:{{{build|}}}|{{{version|}}}{{{build|}}}}}or first{{{platform|}}}{{{version|}}}{{{build|}}} {{#vardefine:row:vanchors:{{{version|}}}:{{{build|}}}|{{{version|}}}}} {{#vardefine:row:pvanchors:{{{version|}}}:{{{build|}}}|{{{platform|}}}{{{version|}}}}} {{#vardefine:row:pvbanchors:{{{version|}}}:{{{build|}}}|{{{platform|}}}{{{version|}}}{{{build|}}}}} {{#vardefine:row:{{{version|}}}|{{{date|}}}}} {{#vardefine:v-length|{{#ifexpr:{{#lstcnt:{{{version|}}}|.}}>{{#var:v-length|0}}|{{#lstcnt:{{{version|}}}|.}}|{{#var:v-length}}}}}} {{#arraydefine:row|{{{platform|}}}¤{{{version|}}}¤{{{build|}}}¤{{{date|}}}¤{{{name|}}}¤{{{rawref|}}}¤{{{ref|}}}¤{{{note|}}}¤{{{changes|}}}‡|¤}} {{#arraymerge:rows |rows |row}}

{{#vardefine:all|{{#ifexpr:{{#var:row:v}}>{{#padright:109|{{#expr:{{#var:v-length}}-3}}|0}}|{{#var:all-platform}}|}}}} {{#vardefine:row:v| {{#lstelem:{{{version|}}}|.|1}} {{#padleft:{{#lstelem:{{{version|}}}|.|2}}|2|0}} {{#padleft:{{#lstelem:{{{version|}}}|.|5}}|3|0}} {{#lstmap:{{#lstsub:{{{version|}}}|.|.|4|{{#expr:{{#var:v-length}}-3}}|.|@@@|{{#padleft:@@@|2|0}}|}} }}

{{#if:{{{v|}}}|{{#lstmaptemp:{{{platform|}}}|icon|/|&thinsp;}} {{{v}}}|{{#lstsep:{{#forargs:v-|platform|version|{{#if:{{#var:version}}|{{#lstmaptemp:{{#var:platform}}|icon|-|&thinsp;}} {{#var:version}}¤‡}}}}|¤‡| }}}}{{#if:{{{name|}}}|{{note|block=y|small=y|{{{name}}}}}}} {{#if:{{{date|}}}|{{date|date={{{date}}}}}{{#or:{{{rawref|}}}|{{#if:{{{ref|}}}|{{#tag:ref|{{{ref}}}}}}}}}|{{#if:{{{ref|}}}|{{#vardefine:commonref_name|cvh{{#vardefineecho:_cvh:counter|{{#expr:{{#var:_cvh:counter}}+1}}}}}}{{#vardefine:commonref_content|{{{ref}}}}}}}{{#lstsep:{{#forargs:date-|platform|date|{{#if:{{#var:date}}|{{#lstmaptemp:{{#var:platform}}|icon|-|&thinsp;}} {{date|date={{#var:date}}}}{{#if:{{{rawref-{{#var:platform}}|}}}{{{ref-{{#var:platform}}|}}}|{{#or:{{{rawref-{{#var:platform}}|}}}|{{#tag:ref|{{{ref-{{#var:platform}}|}}}}}}}|{{#or:{{{rawref|}}}|{{#if:{{{ref|}}}|{{#tag:ref|{{#var:commonref_content}}|name={{#var:commonref_name}}}}{{#vardefine:commonref_content|}}}}}}}}¤‡}}}}|¤‡| }}}}  {{#if:{{{note|}}}|{{{note}}}}}{{#if:{{{changes|}}}| {{{changes|}}} }}

It takes multiple parameters:

It is possible that an update was released under different names or on different dates on the different platforms. To reflect this, append the platform name(s) to the {{code|$v}}, {{code|$date}}, {{code|$ref}}, and {{code|$rawref}} parameters with a hyphen, i.e.,  , etc. The platform names must be valid as per Template:Icon, and multiple are to be separated with another hyphen. If the non-platform-specific {{code|$v}} or {{code|$date}} parameters are specified, then the respective platform-specific ones have no effect.

For instance, if the update "1.234" was released on Jan 1, 2018 on Xbox One and PlayStation 4, but on Jan 15 on Switch, the following code could be used:
 * v = 1.234
 * date-ps4-xbox one = 2018/01/01
 * date-switch = 2018/01/15
 * ref-ps4-xbox one = {{forums thread|some-thread-about-xbox-and-playstation-release}}
 * rawref-switch =