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

trying Howcheng's variant
Prevent linebreak that causes <p>, compensate with top margin.
১ নং লাইন: ১ নং লাইন:
<div class="thumbinner mp-thumb" style="background:none; border:none; max-width:{{str number/trim|{{if empty|{{{width|}}}|120}}}}px;">
<div class="thumbinner mp-thumb" style="background:none; border:none; margin-top:0.5em; max-width:{{str number/trim|{{if empty|{{{width|}}}|120}}}}px;">
[[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 (if neither supplied, MediaWiki uses the filename as the alt text)-->{{{alt|{{{caption<noinclude>|Caption goes here.</noinclude>}}}}}} <!--add link if exists-->{{#if:{{{link|}}} | {{#ifeq:{{remove file prefix|{{{link}}}}}|{{remove file prefix|{{{image}}}}}| <!--do nothing if {{{link}}} and {{{image}}} are the same-->| {{!}}link=File:{{remove file prefix|{{{link}}}}} }}<!--end #ifeq for link/image comparison--> }}<!--end #if for link-->]]
[[File:<!--if {{{image}} begins with File:/Image: remove it-->{{Remove file prefix|{{{image<noinclude>|Example.png</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 (if neither supplied, MediaWiki uses the filename as the alt text)-->{{{alt|{{{caption<noinclude>|Caption goes here.</noinclude>}}}}}} <!--add link if exists-->{{#if:{{{link|}}} | {{#ifeq:{{remove file prefix|{{{link}}}}}|{{remove file prefix|{{{image}}}}}| <!--do nothing if {{{link}}} and {{{image}}} are the same-->| {{!}}link=File:{{remove file prefix|{{{link}}}}} }}<!--end #ifeq for link/image comparison--> }}<!--end #if for link-->]]{{#if: {{{caption<noinclude>|Caption goes here.</noinclude>}}} |
{{#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 class="thumbcaption" style="word-wrap: break-word; {{#if: {{{caption align|}}} | text-align: {{{caption align}}};}}">{{{caption<noinclude>|Caption goes here.</noinclude>}}}</div>
| }}
</div>
</div>
<noinclude>
<noinclude>
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>