Difference between revisions of "Template:Main page image/ITN"

From Donjon Wiki
Jump to navigation Jump to search
(Created page with "<div class="thumbinner mp-thumb" style="background: transparent; border: none; padding: 0; max-width: {{#expr:{{str number/trim|{{if empty|{{{width|}}}|120}}}}{{#ifeq:{{{borde...")
 
 
Line 1: Line 1:
<div class="thumbinner mp-thumb" style="background: transparent; border: none; padding: 0; max-width: {{#expr:{{str number/trim|{{if empty|{{{width|}}}|120}}}}{{#ifeq:{{{border|}}}|yes|+2}}}}px;">
{{#if:{{{image|}}}|<templatestyles src="Main page image/ITN/styles.css"/><div role="figure" class="itn-img">
[[File:<!--if {{{image}}} begins with File:/Image: remove it-->{{PAGENAME:{{{image|{{{1<noinclude>|Example-serious.jpg</noinclude>}}}}}}}}{{#ifeq:{{{border|}}}|yes|{{!}}border|}}|<!-- if {{{width}}} ends with "px" then remove it -->{{Str rep|{{#invoke:string|replace|{{#if:{{{width|}}}|{{{width}}}|120}}|px$||plain=false}}px|-nanpx|frameless}}<!-- title (use caption, alt text or non-default link target if not available) -->{{#if:{{{title|}}} | {{!}}{{{title}}} | {{#if:{{{caption|{{{2|}}}}}} | {{!}}{{{caption|{{{2|}}}}}} | {{!}}{{{alt|}}}}}}} <!-- alt text (use caption, title or image name if not available) --> {{#if:{{{alt|}}} | {{!}}alt={{{alt}}}}} <!--add link if exists-->{{#if:{{{link|}}} | {{#ifeq:{{PAGENAME:{{{link}}}}}|{{PAGENAME:{{{image}}}}}| <!--do nothing if {{{link}}} and {{{image}}} are the same-->| {{!}}link=File:{{PAGENAME:{{{link}}}}} }}<!--end #ifeq for link/image comparison--> }}<!--end #if for link-->{{#if:
{{main page image|image={{{image}}}|border={{#ifeq:{{{border}}}|yes|yes|}}|width={{#if:{{{width|}}}|{{{width}}}|{{#invoke:Main_page_image|width|{{PAGENAME:{{{image}}}}}}}}}|title={{#if:{{{title|}}}|{{{title}}}}}|alt={{#if:{{{alt|}}}|{{{alt}}}}}|caption={{#if:{{{caption|}}}|{{{caption}}}}}|caption align={{#if:{{{caption align|}}}|{{{caption align}}}}}|link={{#if:{{{link|}}}|{{{link}}}}}}}
{{{thumbtime|}}} | {{!}}thumbtime={{{thumbtime}}} }}]]{{#if: {{{caption|{{{2|<noinclude>Caption goes here.</noinclude>}}}}}}|
</div>}}<noinclude>
<div class="thumbcaption" style="padding: 0.25em 0; word-wrap: break-word; {{#if:{{{caption align|}}} | text-align: {{{caption align}}};}}">{{{caption|{{{2|<noinclude>Caption goes here.</noinclude>}}}}}}</div>}}</div>
<noinclude>
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>

Latest revision as of 22:10, 6 January 2024