See also: Help:Images on MediaWiki
Images are a core part of the wiki experience, giving readers an idea of what something might look like. Images can be put on pages by linking to them, with many settings to go alongside this. Other file types aside from images can be linked using similar syntax.
Syntax[]
Image syntax is as simple as [[File:Filename.extension|options|caption]]
. There are many options that can be applied to images.
The most commonly used image option is image size, which can be used by including a pixel value. Pixel lengths must be followed by px
. Including an x
before the pixel size will cause it to be treated as a height value instead of a width value. Both width and height can be included, but only the smaller value will be used when generating images. This is for parity with other features that use both width and height. Including neither width nor height will lead to the image's base dimensions being used, which should not be relied upon.
Images can function as links by adding link=[link]
, leading readers to the link as opposed to the image's file page. It does not need brackets ([[]]
), as only the page's name is needed. If one wishes to link to a page outside of the (main) namespace, they can include the namespace beforehand, such as the via Template:Kill icon
. Including no page, and leaving the field as link=
, causes the image to not open anything when clicked.
- Input
[[File:Shock & Terror.png|40px]]<br> [[File:Placeholder.png|x40px]]<br> [[File:Shock & Terror.png|60x80000px|link=]]<br> [[File:Placeholder Kill Icon.png|link=Template:Kill icon]]<br> [[File:Shock & Terror.png|link=Shock and Awe]]<br>
- Output
There are also different types of images, that function differently and have different features. There is the default one, border, frameless, frame, thumb, and frameless and border together.
The style conventions on the wiki lend themselves to only using the default image type, which doesn't have captions. In most cases, it's easier to have an image with few inherent properties, and manually add onto it. In the case that captions are needed, the best option is likely thumb
.
An option becomes a caption if the image type supports it, it does not use any other options' syntax, and it is the last option.
- Input
[[File:Shock & Terror.png|80px|thumb|this is a caption because it is last and not any other type of syntax]]
- Output
this is a caption because it is last and not any other type of syntax
- Input
[[File:Shock & Terror.png|80px|this caption does not appear because it is not supported by the default image type]]
- Output
- Input
[[File:Shock & Terror.png|80px|thumb|center|thumb defaults to right, unlike the default image type which defaults to inline]]
- Output
thumb defaults to right, unlike the default image type which defaults to inline
Galleries[]
Galleries provide a way to neatly format files in large groups. This is mainly used with images, but other file types are also supported.
To make a gallery, place <gallery>
before the images and </gallery>
after them. From there, remove the square brackets ([[]]
), File:
, and all options aside from captions and links, which are the only two features that are supported. Each image must be on a separate line. A gallery will still work if File:
is included, but doing such a thing is considered bad practice.
- Input
-
<gallery> Shock & Terror.png|40px File:Shock & Terror.png|200px [[File:Shock & Terror.png|50px]] Shock & Terror.png|link=Shock and Awe|Only captions and links have any affect </gallery>
- Output
Gallery options will be applied to all the entries in the gallery, since galleries are made for consistency. Gallery options aren't often on this wiki, aside from on pages like crates, so they won't be discussed at length here. More information can be found on Community Central's Help:Galleries page.
- Input
-
<gallery widths="50"> Shock & Terror.png|Only way to change galleries Shock & Terror.png|Is by directly modifying <gallery> </gallery>
- Output