Difference between revisions of "Gallery"

From Sega Retro

 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#fornumargs:galleryindex
+
<includeonly>{{#vardefine:gallerywidths|{{{widths|}}}}}{{#vardefine:galleryscreens|{{{screens|}}}}}{{#fornumargs: i
|gallerycontent
+
| v
|{{#vardefine:gallerycontentfile|{{#explode:{{#var:gallerycontent}}|¦|0}}}}{{#ifeq:{{#pos:{{#explode:{{#var:gallerycontent}}|¦|1}}|page#}}|0
+
| {{#if: {{#pos:jpg jpeg png gif pdf mp4 svg|{{fileext|{{#var:v}}}}}} | {{gitem|{{#var:v}}}} | {{#var:v}} }}
|{{#vardefine:gallerycontentpage|{{#replace:{{#explode:{{#var:gallerycontent}}|¦|1}}|#|=}}}}{{#vardefine:gallerycontentcaption|{{#explode:{{#var:gallerycontent}}|¦|2}}}}
+
}}{{clearvar|gallerywidths|galleryscreens}}</includeonly><noinclude>
|{{#vardefine:gallerycontentpage|}}{{#vardefine:gallerycontentcaption|{{#explode:{{#var:gallerycontent}}|¦|1}}}}
 
}}<div style="display:inline-block; position:relative; 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|{{#var:gallerycontentpage}}]]</div><div style="position:absolute; top:152; left:0; width:100%; padding-left:2px; padding-top:9px; padding-right:2px; margin-bottom: 1em;">{{#var:gallerycontentcaption}}</div></div>
 
}}</includeonly><noinclude>
 
 
==Usage==
 
==Usage==
 +
<pre>
 
{{gallery
 
{{gallery
|sonic1_title.png¦''Sonic the Hedgehog'' title screen
+
|{{gitem|Mega UK 01.pdf|page=10-11|Two pages from a UK magazine}}
|Mega UK 01.pdf¦page#10-11¦Two pages from a UK magazine
+
{{gitem|Mega UK 01.pdf|page=10-11,13-14,18|Five pages from a UK magazine}}
 +
|sonic1_title.png
 
}}
 
}}
[[Category:Sega Retro templates]]</noinclude>
+
</pre>
 +
 
 +
'''Returns:'''
 +
 
 +
{{gallery
 +
|{{gitem|Mega UK 01.pdf|page=10-11|Two pages from a UK magazine}}
 +
{{gitem|Mega UK 01.pdf|page=10-11,13-14,18|Five pages from a UK magazine}}
 +
|sonic1_title.png
 +
}}
 +
[[Category:Templates]]</noinclude>

Latest revision as of 12:54, 21 April 2022

Usage

{{gallery
|{{gitem|Mega UK 01.pdf|page=10-11|Two pages from a UK magazine}}
{{gitem|Mega UK 01.pdf|page=10-11,13-14,18|Five pages from a UK magazine}}
|sonic1_title.png
}}

Returns:

Expression error: Unexpected < operator. File:Mega UK 01.pdfFile:Mega UK 01.pdf

PDF
<div style="width:Expression error: Unexpected < operator.px; padding-left:2px; padding-top:5px; padding-right:2px;">Two pages from a UK magazine
<div style="width:Expression error: Unexpected < operator.px; padding-left:2px; padding-top:5px; padding-right:2px;">Five pages from a UK magazine
Sonic1 title.png
Sonic1 title.png