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}}}}{{#ifeq:{{#pos:{{#explode:{{#var:gallerycontent}}|¦|1}}|page#}}|0
+
|
|{{#vardefine:gallerycontentpage|{{#replace:{{#explode:{{#var:gallerycontent}}|¦|1}}|#|=}}}}{{#vardefine:gallerycontentcaption|{{#explode:{{#var:gallerycontent}}|¦|2}}}}
+
{{#vardefine:gallerycontentfile|{{#explode:{{#var:gallerycontent}}|¦|0}}}}
|{{#vardefine:gallerycontentpage|}}{{#vardefine:gallerycontentcaption|{{#explode:{{#var:gallerycontent}}|¦|1}}}}
+
{{#vardefine:gallerycontentpage|}}{{#vardefine:gallerycontentcaption|}}{{#vardefine:gallerycaptionwidth|152}}
}}<div style="display:inline-block; position:relative; vertical-align:top; font-size:9pt; margin-left:9px; margin-bottom:40px;"><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|{{#var:gallerycontentpage}}]]</div><div style="position:absolute; top:152; left:0; width:100%; padding-left:2px; padding-top:9px; padding-right:2px;">{{#var:gallerycontentcaption}}</div></div>
+
{{#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==

Revision as of 14:09, 5 July 2016

Usage

Sonic1 title.png
Sonic the Hedgehog title screen
Two pages from a UK magazine