Difference between revisions of "Template:Gallery"

From MansonWiki, the Marilyn Manson encyclopedia
Jump to: navigation, search
m (Scarshock moved page Template:Photos to Template:Gallery without leaving a redirect)
 
(47 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>
+
<includeonly><center>
{{#vardefine:WIDTHS | 120px }}
+
{{#tag:gallery
{{#vardefine:HEIGHTS | 170px }}
+
| {{#forargs: | K | V |<nowiki/>
{{#vardefine:PERROW | 5 }}
+
    {{#switch: {{#var: K}}
{{#fornumargs: K | V |
+
    | /class =
  {{#vardefine:KEY | {{#explode: {{#var: V}} | : | 0 }} }}
+
    | /caption =
  {{#vardefine:VALUE | {{#explode: {{#var: V}} | : | 1 }} }}
+
    | /heights =
  {{#switch: {{#var:KEY}}
+
    | /mode =
  | perrow = {{#vardefine:PERROW | {{#var:VALUE}} }}
+
    | /perrow =
  | widths = {{#vardefine:WIDTHS | {{#var:VALUE}} }}
+
    | /widths =
  | heights = {{#vardefine:HEIGHTS | {{#var:VALUE}} }}
+
    | Image:{{#var: K}} {{!}} <center>{{#var: V}}</center>
 +
    }}
 
   }}
 
   }}
 +
| mode = {{{/mode|packed}}}
 +
| class = decreaseCaptions {{{/class|}}}
 +
| caption = {{{/caption|}}}
 +
| perrow = {{{/perrow|5}}}
 +
| heights = {{{/heights|200px}}}
 +
| widths = {{{/widths|150px}}}
 
}}
 
}}
<center>
 
{{#tag:gallery
 
| {{#forargs: | K | V |<nowiki/>
 
{{#switch: {{#len: {{#var: K}} }}
 
| 1 =
 
| Image:{{#var: K}}<nowiki/> {{!}} <center>'' {{#var: V}} ''</center>
 
}} <!-- #switch -->
 
}} <!-- #forargs -->
 
| widths = {{#var:WIDTHS}}
 
| heights = {{#var:HEIGHTS}}
 
| perrow = {{#var:PERROW}}
 
}} <!-- #tag -->
 
 
</center></includeonly><noinclude>
 
</center></includeonly><noinclude>
 +
Sample usage:
  
 
<pre><nowiki>
 
<pre><nowiki>
 
{{Photos
 
{{Photos
| filename1.jpg = Description 1
+
| /class                = bold-first-line
| filename2.jpg = &lt;!-- just leave empty if no description --&gt;
+
| /caption              = Some photos
| filename3.jpg = Description 3
+
| /mode                = packed
| perrow:3       &lt;!-- three photos per row --&gt;
+
| /perrow               = 3
| widths:100px    &lt;!-- thumb placeholder width is 100 px --&gt;
+
| /widths               = 200
| heights:50px    &lt;!-- thumb placeholder height is 50px --&gt;
+
| /heights             = 200
|
+
| Gloria.jpg            = Photo: Photo credit and thanks to Gloria
...
+
| Charlotte_Sumisu.jpg  = Photo: Photo credit and thanks to Charlotte Sumisu
 +
| Charlotte_Sumisu2.jpg = Photo: Photo credit and thanks to Charlotte Sumisu
 +
| Charlotte_Sumisu3.jpg = Photo: Photo credit and thanks to Charlotte Sumisu
 +
| V_mera_Luna.jpg      = Photo: [https://www.facebook.com/events/177705679104830/ M'era Luna Festival]
 
}}
 
}}
</nowiki></pre>
+
</nowiki></pre></noinclude>
 
+
</noinclude>
+

Latest revision as of 13:10, 8 February 2024

Sample usage:

{{Photos
| /class                = bold-first-line
| /caption              = Some photos
| /mode                 = packed
| /perrow               = 3
| /widths               = 200
| /heights              = 200
| Gloria.jpg            = Photo: Photo credit and thanks to Gloria
| Charlotte_Sumisu.jpg  = Photo: Photo credit and thanks to Charlotte Sumisu
| Charlotte_Sumisu2.jpg = Photo: Photo credit and thanks to Charlotte Sumisu
| Charlotte_Sumisu3.jpg = Photo: Photo credit and thanks to Charlotte Sumisu
| V_mera_Luna.jpg       = Photo: [https://www.facebook.com/events/177705679104830/ M'era Luna Festival]
}}