Template:Multiple image: Difference between revisions

(replace template with exact copy of Wikipedia version)
No edit summary
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{#if:{{{image1|}}}{{{image2|}}}{{{image3|}}}{{{image4|}}}{{{image5|}}}{{{image6|}}}{{{image7|}}}{{{image8|}}}{{{image9|}}}{{{image10|}}}|<div class="thumb {{#switch: {{{align|}}} | left = tleft|none | 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="position: relative; z-index: 100; {{#switch: {{{align|}}} | center | centre = margin: 0 auto;}}{{#if:{{{background color|}}}|background-color: {{{background color}}} }}">
If stacked vertically, box width = largest width + 12 px (6 px margin on left and right) -->
<div class="thumbinner" {{#if:{{{background color|}}}|style="background-color: {{{background color}}}}}">
| vertical              = {{#expr:
    {{#if:{{{width|}}}
      | {{{width}}}
      | {{Max/12 | {{{width1|200}}} | {{{width2|}}} | {{{width3|}}} | {{{width4|}}} | {{{width5|}}} | {{{width6|}}} | {{{width7|}}} | {{{width8|}}} | {{{width9|}}} | {{{width10|}}} | 0 }}
    }}
    + 12
  }}
| horizontal | #default  = {{#if:{{{width|}}}<!--
  If stacked horizontally and a single common width was passed for use in all images,
  box width = (common width + 4px) * number of images + 8px.
  This creates a 4px margin between the images, and a 6px margin on each side -->
  |{{#expr:
      ({{{width}}}+4)
      *
      {{Template:Multiple image/numImgs | {{{image1|}}} | {{{image2|}}} | {{{image3|}}} | {{{image4|}}} | {{{image5|}}} | {{{image6|}}} | {{{image7|}}} | {{{image8|}}} | {{{image9|}}} | {{{image10|}}} }}
      +
      8
      }}<!--
  If stacked horizontally and a custom width was passed for each image,
  box width = sum of all widths + 4px of margin between each pair of images + 16px of margin (8px on each side of the box) (why not 6px as in other cases?...) -->
  |{{#expr:
      {{#if:{{{image1|}}} |{{{width1|200}}}}}+
      {{#if:{{{image2|}}} |{{{width2|200}}}}}+
      {{#if:{{{image3|}}} |{{{width3|200}}}}}+
      {{#if:{{{image4|}}} |{{{width4|200}}}}}+
      {{#if:{{{image5|}}} |{{{width5|200}}}}}+
      {{#if:{{{image6|}}} |{{{width6|200}}}}}+
      {{#if:{{{image7|}}} |{{{width7|200}}}}}+
      {{#if:{{{image8|}}} |{{{width8|200}}}}}+
      {{#if:{{{image9|}}} |{{{width9|200}}}}}+
      {{#if:{{{image10|}}} |{{{width10|200}}}}}
      +
      4 * ({{Template:Multiple image/numImgs | {{{image1|}}} | {{{image2|}}} | {{{image3|}}} | {{{image4|}}} | {{{image5|}}} | {{{image6|}}} | {{{image7|}}} | {{{image8|}}} | {{{image9|}}} | {{{image10|}}} }} - 2)
      +
      16
      }}
  }}
}}px; {{#switch: {{{align|}}} | center | centre = margin: 0 auto;}}{{#if:{{{background color|}}}|background-color: {{{background color}}} }}">
<div class="thumbinner" {{#if:{{{background color|}}}|style="background-color: {{{background color}}}"}}>
{{#if:{{{header|}}}|
{{#if:{{{header|}}}|
<div style="clear: both; font-weight: bold; text-align: {{{header_align|center}}}; background-color: {{{header_background|transparent}}}">
<div style="clear: both; font-weight: bold; text-align: {{{header_align|center}}}; background-color: {{{header_background|transparent}}}">
Line 131: Line 92:
</div>
</div>
</div>
</div>
}}<noinclude>{{doc}}<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --></noinclude>
}}<noinclude>{{documentation}}[[Category:Templates]]<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --></noinclude>

Latest revision as of 11:18, 31 March 2023

[view] [edit] [history] [purge] Documentation icon Template documentation