Template:Image width/doc

From Yugipedia
< Template:Image width
Revision as of 15:43, 15 February 2015 by Dinobot1000 (talk | contribs) (See also: rm redundant sortkey(s))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Usage[edit]

This template is meant to normalize values supplied for image widths. It should be used in conjunction with {{px}}.

It takes two unnamed parameters, the first being the value to test and the second being the fallback value. If the first parameter is not supplied, not a valid number (if it has letters or other non-numeric characters), or larger than/equal to the fallback value, the fallback is used instead. If no fallback is supplied, the template returns nothing for invalid input.

Three more optional unnamed parameters are available to add tracking categories for invalid input: the third one is added in cases where the first parameter is not a valid number or is larger than/equal to the fallback parameter, the fourth parameter is added when the first parameter is larger than/equal to the fallback parameter (and overrides the third parameter), and the fifth parameter is added if no input is supplied for the first parameter.

See also[edit]