Difference between revisions of "Gallery"

From Sega Retro

Line 1: Line 1:
<includeonly>{{#fornumargs:galleryindex
+
<includeonly>{{#fornumargs: i
|gallerycontent
+
| v
|
+
| {{#if: {{#pos:{{#var:v}}|¦}} | [[Category:Use Gitem template]]{{#vardefine:v|{{#explode:{{#var:v}}|¦|0}}}} }}{{#if: {{#pos:jpg jpeg png gif pdf mp4 svg|{{fileext|{{#var:v}}}}}} | {{gitem|{{#var:v}}}} | {{#var:v}}
{{#vardefine:gallerycontentfile|{{#explode:{{#var:gallerycontent}}|¦|0}}}}
 
{{#vardefine:gallerycontentpage|}}{{#vardefine:gallerycontentcaption|}}{{#vardefine:gallerycaptionwidth|152}}
 
{{#loop:galleryloop
 
|1
 
|2
 
|{{#vardefine:gallerysub|{{#explode:{{#var:gallerycontent}}|¦|{{#var:galleryloop}}}}}}
 
{{#ifeq:{{#pos:{{#var:gallerysub}}|page#}}|0
 
|{{#vardefine:gallerycontentpage|{{#replace:{{#var:gallerysub}}|page#}}}}
 
  {{#if:{{#pos:{{#var:gallerysub}}|-}}{{#pos:{{#var:gallerysub}}|,}}|{{#vardefine:gallerycaptionwidth|{{#expr:({{d2w|{{#var:gallerycontentfile}}|120|120}}*{{pagecount|{{#var:gallerycontentpage}}}})+30}}}}}}
 
|{{#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;">{{#vardefine:gallerycontentpage|{{expandpages|{{#var:gallerycontentpage}}}}}}
 
{{#loop: chunknum
 
|0
 
|{{#expr:{{charcount|{{#var:gallerycontentpage}}|,}}+1}}
 
|{{#vardefine:pagechunk|{{#explode:{{#var:gallerycontentpage}}|,|{{#var:chunknum}}}}}}
 
[[File:{{#var:gallerycontentfile}}|120x120px|{{#if:{{#var:gallerycontentpage}}|page={{#var:pagechunk}}}}]]
 
 
}}
 
}}
</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==
 
<pre>
 
<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}}
|Mega UK 01.pdf¦page#10-11,13-14,18¦Five pages from a UK magazine
+
|sonic1_title.png
 
}}
 
}}
 
</pre>
 
</pre>
Line 34: Line 16:
  
 
{{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}}
|Mega UK 01.pdf¦page#10-11,13-14,18¦Five pages from a UK magazine
+
|sonic1_title.png
 
}}
 
}}
 
[[Category:Sega Retro templates]]</noinclude>
 
[[Category:Sega Retro templates]]</noinclude>

Revision as of 22:48, 20 May 2017

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