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]]1 | <includeonly><p class="InfoboxScreenshot">{{#if:{{{image|}}}|[[Image: {{{image|}}}|{{{width|296px}}}|Upload a picture]]1 | ||
− | |{{Exists|page=File | + | |{{Exists|page=File:{{ReplaceFileSpecialChars|{{PAGENAME}}}}.jpg|then=[[Image:{{urlencode:{{ReplaceFileSpecialChars|{{PAGENAME}}}}}}.jpg|{{{width|296px}}}|Upload a picture]]2|else=[[File:TitleTemplate.png|{{{width|296px}}}|link={{fullurl:Special:Upload|wpDestFile={{urlencode:{{ReplaceFileSpecialChars|{{PAGENAME}}}}}}.jpg}}]]3}}}}</p></includeonly><noinclude>{{Clr}}{{Documentation}}[[Category:Infobox Templates]]</noinclude><nowiki/> |
Revision as of 20:42, 12 August 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.
- uses Template: {{InfoboxScreenshot/Loader}}
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)