Module:File link/doc: Difference between revisions
From Mariopedia, a wiki on Mario, Yoshi, Wario, Donkey Kong, Super Smash Bros., and more!
Jump to navigationJump to search
Content deleted Content added
→Basic usage: add output example |
add alignment methods |
||
Line 72: | Line 72: | ||
</source> |
</source> |
||
Sets the display format. <var>s</var> must either be nil, or one of the strings 'thumb', 'thumbnail', 'frame', 'framed', or 'frameless'. To see the effect of each of these |
Sets the display format. <var>s</var> must either be nil, or one of the strings 'thumb', 'thumbnail', 'frame', 'framed', or 'frameless'. To see the effect of each of these values, see the [[mw:Help:Images#Format|images help page on mediawiki.org]]. Note that the ''border'' format is not set with this method, but with the [[#Border|border method]]. (This is because the border option can be set independently of the values that can be set with this method, for example in the code <code><nowiki>[[File:Example.png|frameless|border|caption]]</nowiki></code>.) |
||
The <var>filename</var> variable is an optional variable that can be used to set the filename for thumbnails. The filename specified will be used instead of the automatically generated thumbnail. This option doesn't have any effect on the other format options. |
The <var>filename</var> variable is an optional variable that can be used to set the filename for thumbnails. The filename specified will be used instead of the automatically generated thumbnail. This option doesn't have any effect on the other format options. |
||
Line 107: | Line 107: | ||
Sets the ''upright'' option, used for images that are taller than they are wide. <var>isUpright</var> must either be nil, or a boolean value. The upright option will be set if <var>isUpright</var> is true. <var>factor</var> provides an optional conversion factor for the upright option; the factor is the image's width divided by its height. If no factor is specified, the MediaWiki software uses the default of 0.75. <var>factor</var> must be either nil or a number value. If a width or height has been set with the [[#Width|width]] or [[#Height|height]] methods, then setting the upright value will result in an error. |
Sets the ''upright'' option, used for images that are taller than they are wide. <var>isUpright</var> must either be nil, or a boolean value. The upright option will be set if <var>isUpright</var> is true. <var>factor</var> provides an optional conversion factor for the upright option; the factor is the image's width divided by its height. If no factor is specified, the MediaWiki software uses the default of 0.75. <var>factor</var> must be either nil or a number value. If a width or height has been set with the [[#Width|width]] or [[#Height|height]] methods, then setting the upright value will result in an error. |
||
=== ResetSize === |
|||
<source lang="lua"> |
|||
obj:resetSize() |
|||
</source> |
|||
This method clears any size-related data the fileLink object is holding. This includes width, height, the upright option, and any upright factor. |
|||
=== Location === |
|||
<source lang="lua"> |
|||
obj:location(s) |
|||
</source> |
|||
Sets the ''location'' option. This is also known as the ''horizontal alignment'' option. <var>s</var> must either be nil, or one of the strings 'right', 'left', 'center', or 'none'. To see the effect of each of these values, see the [[mw:Help:Images#Horizontal alignment|images help page on mediawiki.org]]. |
|||
=== Alignment === |
|||
<source lang="lua"> |
|||
obj:alignment(s) |
|||
</source> |
|||
Sets the ''alignment'' option. This is also known as the ''vertical alignment'' option. <var>s</var> must either be nil, or one of the strings 'baseline', 'middle', 'sub', 'super', 'text-top', 'text-bottom', 'top', or 'bottom'. To see the effect of each of these values, see the [[mw:Help:Images#Vertical alignment|images help page on mediawiki.org]]. |
|||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| |
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| |