Template:Gallery Game: Difference between revisions

From Forklift Certified Video Games
Jump to navigation Jump to search
Line 1: Line 1:
<includeonly>{{#if:{{{gallery_image|{{{gallery_image1|}}}}}}|
<includeonly>{{#if:{{{gallery_image|{{{gallery_image1|}}}}}}|
== Gallery ==
<!-- 1. HEADER LOGIC: Only print the header once per page -->
{{#tag:gallery|
{{#if: {{#get:gallery_shown}} | | == Gallery =={{#set:gallery_shown=1}} }}
File:{{{gallery_image|{{{gallery_image1|}}}}}}{{!}}{{{gallery_caption|{{{gallery_caption1|}}}}}}
{{#if:{{{gallery_image2|}}}|File:{{{gallery_image2}}}{{!}}{{{gallery_caption2|}}}|}}
{{#if:{{{gallery_image3|}}}|File:{{{gallery_image3}}}{{!}}{{{gallery_caption3|}}}|}}


|mode=packed|widths=175|heights=175|style="text-align:left;"
<!-- 2. IMAGE LOGIC: Force them next to each other using inline-block -->
<div style="display: inline-block; vertical-align: top; margin: 10px 10px 10px 0; width: 175px; text-align: center;">
  <div style="height: 175px; display: flex; align-items: center; justify-content: center; background: #222; border: 1px solid #444; border-radius: 4px;">
    [[File:{{{gallery_image|{{{gallery_image1|}}}}}}|175x175px|center|link={{{gallery_image|{{{gallery_image1|}}}}}}]]
  </div>
  <div style="font-size: 90%; margin-top: 5px; line-height: 1.2; color: #ccc; word-wrap: break-word;">
    {{{gallery_caption|{{{gallery_caption1|}}}}}}
  </div>
</div>
 
<!-- 3. COMPATIBILITY: Handle old fields if they exist -->
{{#if:{{{gallery_image2|}}}|
<div style="display: inline-block; vertical-align: top; margin: 10px 10px 10px 0; width: 175px; text-align: center;">
  <div style="height: 175px; display: flex; align-items: center; justify-content: center; background: #222; border: 1px solid #444; border-radius: 4px;">
    [[File:{{{gallery_image2}}}|175x175px|center|link={{{gallery_image2}}}]]
  </div>
  <div style="font-size: 90%; margin-top: 5px; color: #ccc;">{{{gallery_caption2|}}}</div>
</div>
}}
{{#if:{{{gallery_image3|}}}|
<div style="display: inline-block; vertical-align: top; margin: 10px 10px 10px 0; width: 175px; text-align: center;">
  <div style="height: 175px; display: flex; align-items: center; justify-content: center; background: #222; border: 1px solid #444; border-radius: 4px;">
    [[File:{{{gallery_image3}}}|175x175px|center|link={{{gallery_image3}}}]]
  </div>
  <div style="font-size: 90%; margin-top: 5px; color: #ccc;">{{{gallery_caption3|}}}</div>
</div>
}}
}}
}}</includeonly>
}}<nowiki /></includeonly>

Revision as of 21:09, 25 April 2026