User:Zeal/Sandbox/Templates/img
Jump to navigation
Jump to search
Image Control
- Description:
- Creates an image box you can position and style easily with the option of a caption or thumbnail.
- This is designed to be used as a replacement for the Mediawiki Extended Image Syntax at Wikipedia, which is limited in terms of styling control.
- "width" and "height" are limits rather than specified dimensions, this means the image will maintain it's aspect ratio. specifying "thumb" with a blank value like so "thumb=" will overide these dimension and use 200x200px instead. Values given are considered to be in pixels.
- Floating is forced, with a default of left. This is required to shrink to fit around the image's dynamic size. If you need to clear, use {{clr}}, {{clrl}} or {{clrr}}.
- "frame" and "border" have defaults of inset and outset borders respectively, using the specified background colour or #999 if not present, when given a blank value, like so "frame=" "border=". Alternatively you can overide them with your own styling.
- Syntax:
- {{User:Zeal/Sandbox/Templates/img| <image> | <caption> | <width> | <height> | <float> | image=<-> | clear=<-> | float=<-> | width=<-> | height=<-> | margin=<-> | padding=<-> | border=<-> | frame=<-> | color=<-> | bgcol=<-> | align=<-> | caption=<-> | thumb=<->}}
- Named parameters can be in any order and any or all can be left out.
- Unnamed parameters must be in order and any or all can be left blank.
- Example:
- {{User:Zeal/Sandbox/Templates/img
- |clear=both
- |width=300
- |float=right
- |color=#EEE
- |bgcol=#666
- |border=1px #999 outset
- |frame=1px #999 inset
- |image=Official_map_of_outland.jpg
- |caption=A map of Outland
- }}
- {{User:Zeal/Sandbox/Templates/img
- Result:
- Template: