Template:ImageGrid: Difference between revisions
Appearance
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> | ||
< | <style> | ||
{{# | .imagegrid-flex { | ||
{{#if: {{{ | display: flex; | ||
{{# | flex-wrap: wrap; | ||
gap: 0.5em; | |||
justify-content: center; | |||
} | |||
.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> | ||