Difference between revisions of "Template:InfoboxScreenshot"

From Istaria Lexica

Line 1: Line 1:
<includeonly><p class="InfoboxScreenshot">{{#if:{{{image|}}}|[[Image: {{{image}}}|{{{width|296px}}}|Upload a picture]]|{{Linkless exists|page={{PAGENAME}}.jpg|then=[[Image:{{PAGENAME}}.jpg|{{{width|296px}}}|Upload a picture]]|else=[[File:TitleTemplate.png|{{{width|296px}}}|link={{fullurl:Special:Upload|wpDestFile={{PAGENAMEE}}.jpg}}]]}}}}</p></includeonly><noinclude>{{Clr}}{{Documentation}}[[Category:Infobox Templates]]</noinclude><nowiki/>
+
<includeonly><p class="InfoboxScreenshot">{{#if:{{{image|}}}|[[Image: {{{image}}}|{{{width|296px}}}|Upload a picture]]|{{Exists|page={{PAGENAME}}.jpg|then=[[Image:{{PAGENAME}}.jpg|{{{width|296px}}}|Upload a picture]]|else=[[File:TitleTemplate.png|{{{width|296px}}}|link={{fullurl:Special:Upload|wpDestFile={{PAGENAMEE}}.jpg}}]]}}}}</p></includeonly><noinclude>{{Clr}}{{Documentation}}[[Category:Infobox Templates]]</noinclude><nowiki/>

Revision as of 12:16, 8 July 2022

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

Description[edit]

Adds a screenshot option to a template. Checks for an existing screenshot of the page, named {{PAGENAME}}.jpg. If there is one it will render it, else it prints out a fancy upload option.

Other features:

  • Find pages using this template
  • The image width defaults to 296px.
  • providing an 'image' parameter lets the template skip the search for {{PAGENAME}}.jpg and use the provided file name instead. Good for special filenames and backwards compatibility.

Syntax[edit]

The image parameter lets you provide an alternative image filename. Leave blank if you don't need.

{{InfoboxScreenshot
|image   = provide an image filename
|width   = provide an alternative width. Defaults to 296px
|setprop = if set to 'true' and if the image exists, set a filename property (Primaryimage) for further use
}}

Examples[edit]

{{InfoboxScreenshot
|image   = Bessy.jpg
|width   = 180px
|setprop = true
}}

{{InfoboxScreenshot
|image   = Bessy.jpg
}}


Visit Template:InfoboxScreenshot/doc to edit this text. (How to: document correctly)