Difference between revisions of "Template:Main page image/OTD"
Jump to navigation
Jump to search
test>Coffeeandcrumbs (create OTD image template based on Template:Main page image/DYK) |
test>Coffeeandcrumbs (add option for unnamed parameters) |
||
Line 1: | Line 1: | ||
<div style="float:right;margin-left:0.5em;" id="mp-otd-img"> | <div style="float:right;margin-left:0.5em;" id="mp-otd-img"> | ||
{{Main page image | {{Main page image | ||
− | | image = {{{image|<noinclude>Example-serious.jpg</noinclude>}}} | + | | image = {{{1|{{{image|<noinclude>Example-serious.jpg</noinclude>}}}}}} |
| link = {{{link|}}} | | link = {{{link|}}} | ||
| border = {{{border|}}} | | border = {{{border|}}} | ||
| width = {{{width|{{#invoke:Main_page_image|width|{{Remove file prefix|{{{image|{{{1<noinclude>|Example-serious.jpg</noinclude>}}}}}}}}}}}}} | | width = {{{width|{{#invoke:Main_page_image|width|{{Remove file prefix|{{{image|{{{1<noinclude>|Example-serious.jpg</noinclude>}}}}}}}}}}}}} | ||
− | | caption = {{{caption|<noinclude>Caption goes here.</noinclude>}}} | + | | caption = {{{2|{{{caption|<noinclude>Caption goes here.</noinclude>}}}}}} |
| caption align = {{{caption align|}}} | | caption align = {{{caption align|}}} | ||
| title = {{{title|}}} | | title = {{{title|}}} |
Revision as of 06:50, 29 July 2020
This template is used to automatically put OTD images into the correct format. Currently, it automatically determines the width of the image based on a ratio of the dimensions. It is a wrapper around {{Main page image}}.
Usage
Note: Prefer images in landscape orientation. If you must use one in portrait orientation, avoid very skinny ones. If you must choose a skinny image, note that if you do so, there will be a gap between left or right edge of the image (depending on the what side of the container the template appears) and the edge of the section.
Note that width should not be specified. It is automatically calculated.
{{Main page image/OTD | image = <!-- name of the file, with or without the File: prefix --> | link = <!-- optional: file to which you want the image to link, with or without the File: prefix --> | border = <!-- optional: "yes" for a border; defaults to no border --> | caption = <!-- optional: wiki text --> | caption align = <!-- optional: left, right, or center; defaults to left --> | title = <!-- optional: image title; if blank, will use the caption, alt text, non-default "link=" target, or nothing (in that order) --> | alt = <!-- optional: image alt text; if blank, will use the caption, title, or image name (in that order) --> | width = <!-- optional: overrides image width --> }}
The above documentation is transcluded from Template:Main page image/OTD/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |