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|}}}}}}|
{{#if:{{{gallery_image1|}}}{{{gallery_image|}}}|
<!-- 1. HEADER LOGIC: Only print the header once per page -->
{{#if:{{{gallery_image1|}}}|== Gallery ==}}
{{#if: {{#get:gallery_shown}} | | == Gallery =={{#set:gallery_shown=1}} }}
{{#tag:gallery|
{{#if:{{{gallery_image1|}}}|File:{{{gallery_image1|}}}{{!}}{{{gallery_caption1|}}}|}}
{{#if:{{{gallery_image2|}}}|File:{{{gallery_image2|}}}{{!}}{{{gallery_caption2|}}}|}}
{{#if:{{{gallery_image3|}}}|File:{{{gallery_image3|}}}{{!}}{{{gallery_caption3|}}}|}}
{{#if:{{{gallery_image|}}}|File:{{{gallery_image|}}}{{!}}{{{gallery_caption|}}}|}}


<!-- 2. IMAGE LOGIC: Force them next to each other using inline-block -->
|mode=packed|widths=175|heights=175|style="text-align:left;"
<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>
}}
}}
}}<nowiki /></includeonly>

Revision as of 21:10, 25 April 2026