Difference between revisions of "Template:Double image"
(update classes) |
(updating classes and tags) |
||
Line 1: | Line 1: | ||
<noinclude>{{Wikipedia}} | <noinclude>{{Wikipedia}} | ||
</noinclude><includeonly>{{#switch: {{{1|}}} <!-- first parameter inserts a <div> with a left, right or central float --> | </noinclude><includeonly>{{#switch: {{{1|}}} <!-- first parameter inserts a <div> with a left, right or central float --> | ||
− | | left = < | + | | left = <figure class="article-thumb tleft"> |
− | | right = < | + | | right = <figure class="article-thumb tright"> |
− | | center = <div class="center">< | + | | center = <div class="center"><figure class="article-thumb tnone"> |
− | | #default = < | + | | #default = <figure class="article-thumb tright"> |
− | }}<div class=" | + | }}<div class="image image-thumbnail" style="width:{{#expr: {{{3|0}}} + {{{5|0}}} + 8}}px;"> <!-- calculate width based on image widths +8px --> |
{| style="background: transparent; border: 0; padding: 0; margin: 0; width:{{#expr: {{{3|0}}} + {{{5|0}}} + 4}}px;" cellspacing="0" | {| style="background: transparent; border: 0; padding: 0; margin: 0; width:{{#expr: {{{3|0}}} + {{{5|0}}} + 4}}px;" cellspacing="0" | ||
|- style="vertical-align:{{{valign|middle}}};" | |- style="vertical-align:{{{valign|middle}}};" | ||
Line 13: | Line 13: | ||
|- style="vertical-align:top;" | |- style="vertical-align:top;" | ||
{{#if: {{{7|}}} | <!-- two captions if the seventh param (caption for title two) is specified --> | {{#if: {{{7|}}} | <!-- two captions if the seventh param (caption for title two) is specified --> | ||
− | {{!}} style="padding: 0; margin: 0; border: 0;" {{!}} < | + | {{!}} style="padding: 0; margin: 0; border: 0;" {{!}} <figcaption><p class="caption thumbcaption">{{{6|}}}</p></figcaption> |
{{!}} style="padding: 0; margin: 0; border: 0;" {{!}} | {{!}} style="padding: 0; margin: 0; border: 0;" {{!}} | ||
− | {{!}} style="padding: 0; margin: 0; border: 0;" {{!}} < | + | {{!}} style="padding: 0; margin: 0; border: 0;" {{!}} <figcaption><p class="caption thumbcaption">{{{7|}}}</p></figcaption> |
| <!-- otherwise just have one caption underneath both images --> | | <!-- otherwise just have one caption underneath both images --> | ||
− | {{!}} style="padding: 0; margin: 0; border: 0;" colspan="3" {{!}} < | + | {{!}} style="padding: 0; margin: 0; border: 0;" colspan="3" {{!}} <figcaption><p class="caption thumbcaption">{{{6|}}}</p></figcaption> |
}} | }} | ||
|} | |} | ||
</div> | </div> | ||
{{#switch: {{{1|}}} <!-- as central image float needs two divs, need to close two for center and only one for left/right --> | {{#switch: {{{1|}}} <!-- as central image float needs two divs, need to close two for center and only one for left/right --> | ||
− | | center= </div></ | + | | center= </div></figure> |
− | | </ | + | | #default = </figure> |
}}</includeonly><noinclude>{{documentation}}</noinclude> | }}</includeonly><noinclude>{{documentation}}</noinclude> |
Revision as of 23:53, 13 March 2016
This template uses Creative Commons licensed content from Wikipedia's Template:Double image template.
The list of authors can be seen in the page history there. See Wikipedia's copyrights page for more information. |
Usage
This template creates a box with two images side by side. It needs parameters like this:
{{double image|left/right/center|Left image|Left image size|Right image|Right image size|Left caption|Right caption|Left alt text|Right alt text}}
or
{{double image |1=left/right/center |2=Left image |3=Left image size |4=Right image |5=Right image size |6=Left caption |7=Right caption (leave blank to combine) |8=Left image alt text |9=Right image alt text }}
See wikipedia:WP:ALT for advice about alt text.
Examples
To the right, with one single caption:
{{double image|right|Yellow card.svg|60|Red card.svg|60|Players are cautioned ... round.||Yellow cartouche|Red cartouche}}
To the left. With two captions, one beneath each image:
{{double image|left|Yellow card.svg|60|Red card.svg|60|Yellow|Red|Yellow cartouche|Red cartouche}}
See also
- {{Multiple image}}
- {{Triple image}}