Template:Image

From Zelda Dungeon Wiki
Jump to navigation Jump to search


Purpose

This is a dynamic template that offers enhanced ways of handling images, including ways to:

  • Create captions for transparent images
  • Scale an image based on percentage instead of pixel amounts
  • Constrain an within specific dimensions
  • Create tooltips forimages with frames

None of these options are available or practical with standard image coding. This template allows for simplified ways of performing complex formatting of images.

Usage

To use this template, start with this code:

{{Image
|file        = 
|type         = 
|size         = 
|scale        = 
|align        = 
|caption      = 
|captionalign = 
|title        = 
|alt          = 
|link         = 
}}

Here are descriptions of the parameters. Only the parameter "image" is actually required, the rest are optional.

  • file — The desired image. Do not include a File prefix. (Required )
  • type — The type of display for the image. Choices are normal, thumb, and caption. Normal displays the image without any boxes or captions. Thumb displays the image in the traditional thumbnail box. Caption displays the image without any frame but with a boxed caption below it. (Optional - Defaults to normal if left blank)
  • size — The size of the image. Enter as a pixel number followed by a px, or as a percentage number followed by a %. To specify height instead of width, enter the size as x##px. (Optional )
  • scale — Use this if you instead wish to limit the overall size of the image to a certain pixel or percentage amount. Enter as a pixel number followed by a px, or as a percentage number followed by a %. This will keep the image's dimensions within the specified amount. This is mostly for convenience, the same effect can be done in size through ##x##px, with the same number in both spots. (Optional )
  • align — Set whether the image floats left or right. Note that you can also use "position" as the name for this parameter. (Optional - Defaults to left if not defined.)
  • caption — Caption to display under the image. Only displays for the thumb and caption types. (Optional )
  • captionalign — Alignment of the text in the caption parameter. Options are: left, right, and center. (Optional - Defaults to center.)
  • title — The image's tooltip. (Optional - Defaults to the caption.)
  • alt — The text that is displayed when the image fails to load. (Optional - Defaults to the file name.)
  • link — The desired link. Can be internal or external. If you set this to "none", then the image will not create a link at all. Note: This only changes the image's link and it does not effect the enlarge link in image thumbnails. (Optional - Defaults to the image's page if left blank.)

Examples

Basic

{{Image|file=Magic-Hammer.png}}
File:Magic-Hammer.png


Thumbnail

{{Image|file=Magic-Hammer.png|type=thumb|caption=Magic Hammer from A Link to the Past.}}


File:Magic-Hammer.png
Enlarge
Magic Hammer from A Link to the Past.


Caption

{{Image|file=Magic-Hammer.png|type=caption|caption=Magic Hammer from A Link to the Past.}}


File:Magic-Hammer.png
Magic Hammer from A Link to the Past.