টেমপ্লেট:Main page image: সংশোধিত সংস্করণের মধ্যে পার্থক্য

class
promote from sandbox: border=yes, +link, make width, caption optional, simplify code
১ নং লাইন: ১ নং লাইন:
<div class="thumbinner mp-thumb" style="background:none; border:none; max-width:{{str number/trim|{{{width|120}}}}}px;">
<div class="thumbinner mp-thumb" style="background:none; border:none; max-width:{{str number/trim|{{if empty|{{{width|}}}|120}}}}px;">
[[File:{{Remove file prefix|{{{image<noinclude>|Example.svg</noinclude>}}}}}|{{{border|none}}}|{{#ifeq: {{str endswith|{{{width|120}}} | px}} | yes | {{#ifexpr: {{str find0|{{{width|120}}} | px }} > -1 | {{str left|{{{width|120}}}|{{str find0|{{{width|120}}}}}}} | {{{width|120}}} }}px |{{{alt|{{{caption<noinclude>|Caption goes here.</noinclude>}}}}}} {{#if: {{{link|}}} | {{!}}link={{{link}}} }}]]
[[File:<!--if {{{image}} begins with File:/Image: remove it-->{{Remove file prefix|{{{image<noinclude>|Example.svg</noinclude>}}}}}|{{#ifeq:{{{border|}}}|yes|border|}}|<!-- if {{{width}}} ends with "px" then remove it -->{{#ifeq: {{str endswith|{{if empty|{{{width|}}}|120}} | px}} | yes | <!--do the substring here-->{{str left|{{{width}}}|{{str find0|{{{width}}}|px}} }} | {{if empty|{{{width|}}}|120}} }}px |<!-- alt text, or {{{caption}}} if not available-->{{{alt|{{{caption<noinclude>|Caption goes here.</noinclude>}}}}}} | <!--add link if so desired-->{{#ifeq:{{remove file prefix|{{{link}}}}}|{{remove file prefix|{{{image}}}}}| <!--do nothing if {{{link}}} and {{{image}}} are the same-->|{{#if:{{{link}}}|link=File:{{remove file prefix|{{{link}}}}}}}}}]]
<div class="thumbcaption" style="word-wrap: break-word; {{#if: {{{caption align|}}} | text-align: {{{caption align}}};}}">{{{caption<noinclude>|Caption goes here.</noinclude>}}}</div></div>
{{#if: {{{caption<noinclude>|Caption goes here.</noinclude>}}} |
<div class="thumbcaption" style="word-wrap: break-word; {{#if: {{{caption align|}}} | text-align: {{{caption align}}};}}">{{{caption<noinclude>|Caption goes here.</noinclude>}}}</div>
| }}
</div>
<noinclude>
<noinclude>
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>