Template:Multiple image: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Waldyrious
simplified code / improved readability / added some comments (tested on sandbox)
meta>Waldyrious
fix handling of an empty {{{width}}} parameter
Line 1: Line 1:
{{#if:{{{image1|}}}{{{image2|}}}{{{image3|}}}{{{image4|}}}{{{image5|}}}{{{image6|}}}{{{image7|}}}{{{image8|}}}{{{image9|}}}{{{image10|}}}|<div class="thumb {{#switch: {{{align|}}} | left = tleft | center|centre = tnone | right|#default = tright}}" style="width: {{#switch:{{{direction|}}}<!--
{{#if:{{{image1|}}}{{{image2|}}}{{{image3|}}}{{{image4|}}}{{{image5|}}}{{{image6|}}}{{{image7|}}}{{{image8|}}}{{{image9|}}}{{{image10|}}}|<div class="thumb {{#switch: {{{align|}}} | left = tleft | center|centre = tnone | right|#default = tright}}" style="width: {{#switch:{{{direction|}}}<!--
If stacked vertically, box width = largest width + 12 px (6 px margin on left and right) -->
If stacked vertically, box width = largest width + 12 px (6 px margin on left and right) -->
| vertical              = {{#expr: {{{width | {{Max/27 | {{{width1|}}} | {{{width2|}}} | {{{width3|}}} | {{{width4|}}} | {{{width5|}}} | {{{width6|}}} | {{{width7|}}} | {{{width8|}}} | {{{width9|}}} | {{{width10|}}} }} }}} +12 }}
| vertical              = {{#expr:
    {{#if:{{{width|}}}
      | {{{width}}}
      | {{Max/27 | {{{width1|}}} | {{{width2|}}} | {{{width3|}}} | {{{width4|}}} | {{{width5|}}} | {{{width6|}}} | {{{width7|}}} | {{{width8|}}} | {{{width9|}}} | {{{width10|}}} }}
    }}
    + 12
  }}
| horizontal | #default  = {{#if:{{{width|}}}<!--
| horizontal | #default  = {{#if:{{{width|}}}<!--
   If stacked horizontally and a single common width was passed for use in all images,
   If stacked horizontally and a single common width was passed for use in all images,

Revision as of 17:56, 9 September 2010