Difference between revisions of "Gallery"
From Sega Retro
(think you'll need javascript tbh) |
(streamlined code, working on a way to get caption widths right) |
||
Line 1: | Line 1: | ||
<includeonly>{{#fornumargs:galleryindex | <includeonly>{{#fornumargs:galleryindex | ||
|gallerycontent | |gallerycontent | ||
− | |{{#vardefine:gallerycontentfile|{{#explode:{{#var:gallerycontent}}|¦|0}}}}{{# | + | | |
− | |{{#vardefine: | + | {{#vardefine:gallerycontentfile|{{#explode:{{#var:gallerycontent}}|¦|0}}}} |
− | |{{# | + | {{#vardefine:gallerycontentpage|}}{{#vardefine:gallerycontentcaption|}}{{#vardefine:gallerycaptionwidth|152}} |
− | }}<div style="display:inline-block | + | {{#loop:galleryloop |
+ | |1 | ||
+ | |2 | ||
+ | |{{#vardefine:gallerysub|{{#explode:{{#var:gallerycontent}}|¦|{{#var:galleryloop}}}}}} | ||
+ | {{#ifeq:{{#pos:{{#var:gallerysub}}|page#}}|0 | ||
+ | |{{#vardefine:gallerycontentpage|{{#replace:{{#var:gallerysub}}|page#}}}} | ||
+ | |{{#if:{{#var:gallerysub}}|{{#vardefine:gallerycontentcaption|{{#var:gallerysub}}}}}} | ||
+ | }} | ||
+ | }}<div style="display:inline-block; vertical-align:top; font-size:9pt; margin-left:9px; margin-bottom:9px;"><div style="min-width:152px; min-height:152px; border:solid silver 1px; display:block; text-align:center; padding:15px; font-size:0px;">[[File:{{#var:gallerycontentfile}}|120x120px|{{#if:{{#var:gallerycontentpage}}|page={{#var:gallerycontentpage}}}}]]</div><div style="width:{{#var:gallerycaptionwidth}}px; padding-left:2px; padding-top:9px; padding-right:2px;">{{#var:gallerycontentcaption}}</div></div> | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
==Usage== | ==Usage== |