Difference between revisions of "Template:InfoboxScreenshot/Loader"

From Istaria Lexica

imported>Elteria Shadowhand
 
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}|<div class="InfoboxScreenshot">{{Exists|page=File:{{{1|}}}|then=[[File:{{{1|}}}|{{{2|}}}]]{{#ifeq:{{{3|}}}|true|{{#set:primaryimage=File:{{{1|}}}}}}}|else=[[File:TitleTemplate.png|{{{2|}}}|link={{fullurl:Special:Upload|wpDestFile={{{1|}}}}}]]}}</div>}}</includeonly><noinclude>[[Category:Infobox Templates]][[Category:Non-standalone Templates]]{{Documentation}}</noinclude>
+
<includeonly>{{#if:{{{1|}}}|<div class="InfoboxScreenshot">{{#ifexist:File:{{{1|}}}|[[File:{{{1|}}}|{{{2|}}}]]{{#ifeq:{{{3|}}}|true|{{#set:primaryimage=File:{{{1|}}}}}}}|[[File:TitleTemplate.png|{{{2|}}}|link={{fullurl:Special:Upload|wpDestFile={{{1}}}}}]]}}</div>}}</includeonly><noinclude>[[Category:Infobox Templates]][[Category:Non-standalone Templates]]{{Documentation}}</noinclude>

Latest revision as of 13:17, 29 October 2022

Template documentation (for the template shown above, sometimes hidden or invisible)

Description[edit]

Shows a provided image. If the image does not exist, a fancy 'add image' picture is shown instead. If the image filename is not provided, do nothing.

Other features:

Syntax[edit]

{{InfoboxScreenshot/Loader|image name|width|setprop}}

Parameters[edit]

The parameters are unnamed.

{{InfoboxScreenshot/Loader
| = the filename of the image
| = the final width of the box
| = if set to 'true' and if the image exists, set a filename property (Primaryimage) for further use
}}

Examples[edit]

{{InfoboxScreenshot/Loader|picture.jpg|200px}}
{{InfoboxScreenshot/Loader|anotherpicture.jpg}}
{{InfoboxScreenshot/Loader|yetanotherpicture.jpg|true}}