Jump to content

Template:ImageGrid: Difference between revisions

From Keloidpedia
Created page with "<includeonly> <div style="display:flex; flex-wrap:wrap; gap:10px; justify-content:center;"> {{#if: {{{1|}}} | [[File:{{{1}}}|150px]] }} {{#if: {{{2|}}} | [[File:{{{2}}}|150px]] }} {{#if: {{{3|}}} | [[File:{{{3}}}|150px]] }} {{#if: {{{4|}}} | [[File:{{{4}}}|150px]] }} {{#if: {{{5|}}} | [[File:{{{5}}}|150px]] }} {{#if: {{{6|}}} | [[File:{{{6}}}|150px]] }} </div> </includeonly> <noinclude>"
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
<div style="display:flex; flex-wrap:wrap; gap:10px; justify-content:center;">
<style>
{{#if: {{{1|}}} | [[File:{{{1}}}|150px]] }}
.imagegrid-flex {
{{#if: {{{2|}}} | [[File:{{{2}}}|150px]] }}
  display: flex;
{{#if: {{{3|}}} | [[File:{{{3}}}|150px]] }}
  flex-wrap: wrap;
{{#if: {{{4|}}} | [[File:{{{4}}}|150px]] }}
  gap: 0.5em;
{{#if: {{{5|}}} | [[File:{{{5}}}|150px]] }}
  justify-content: center;
{{#if: {{{6|}}} | [[File:{{{6}}}|150px]] }}
}
.imagegrid-flex img, .imagegrid-flex .mw-file {
  max-width: 200px;
  height: auto;
}
</style>
 
<div class="imagegrid-flex">
  {{#foreach: {{{images|}}} |-
    {{#if: {{{this|}}} |
      <!-- If it looks like a plain filename, use File: prefix; otherwise assume it's a full URL -->
      {{#ifeq: {{#strpos: {{{this}}} | https:// }} | -1 |
        <!-- no URL substring found → treat as wiki image name -->
        [[File:{{{this}}}|frameless]]
      |
        <!-- contains "https://" → embed via <img> -->
        <img src="{{{this}}}" alt="" />
      }}
    }}
  }}
</div>
</div>
</includeonly>
</includeonly>
<noinclude>

Latest revision as of 02:30, 30 September 2025