Images
From Occult Forum.org wiki
This page explains the image syntax when editing the wiki.
Contents |
Syntax
The full syntax for displaying an image is:
[[File:{file_name}|{options}]]
Where options can be zero or more of the following, separated by pipes:
- border, frame, thumb, or frameless: Controls how the image is formatted
- left, right, center, none: Controls the alignment of the image within a text
- baseline, sub, super, top, text-top, middle, bottom, text-bottom: Controls the vertical alignment of the image within a text
- {width} px: Resizes the image to the given width in pixels
- {width}x{height}px: Resizes the image to fit within the given width and height in pixels; it is possible to specify only the height by writing x{height}px
- Note that the image will always retain its aspect ratio.
- link={destination}: Allows to link to an arbitrary title, URL or just nowhere
- alt={alternative text}: For changing the alternative text (alt="") of an image
- Special cases:
- page=1: Displays the specified page when showing a djvu or pdf file
The options can be given in any order. If the given options conflict each other, the latter is applied, except for the format options, where the options take the priority in the order of frame, thumb, and frameless and/or border.
If a given option does not match any of the other possibilities, it is assumed to be the caption text. Caption text can contain wiki links or other formatting. If no caption text is supplied a caption is automatically created showing the file name; to completely remove the caption, set it to <span title=""></span>. For example, [[File:Example.jpg|20px|<span title=""></span>]] →
.
Gallery of images
It's easy to make a gallery of thumbnails only, not other images, with the <gallery> tag. The syntax is:
<gallery>
File:Image Name.ext|caption
File:Image Name.ext|caption
{...}
</gallery>
Note that the image code is not enclosed in brackets when enclosed in gallery tags.
Captions are optional, and may contain wiki links or other formatting.
for example:
<gallery>
File:Example.jpg|Item 1
File:Example.jpg|a link to [[Help:Contents]]
File:Example.jpg
File:Example.jpg
File:Example.jpg| ''italic caption''
File:Example.jpg|on page "{{PAGENAME}}"
</gallery>
is formatted as:
a link to Help:Contents |
|||
Parameters
The gallery tag itself takes several additional parameters:
<gallery {parameters}>
{images}
</gallery>
-
caption={caption}: sets a caption on the gallery. -
widths={width}px: sets the widths of the images. Note the plural, widths -
heights={heights}px: sets the (max) heights of the images. -
perrow={integer}: sets the number of images per row.
Example:
Coding:
<gallery widths=60px heights=60px perrow=7 caption="sunflowers are groovy"> File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg File:Example.jpg </gallery>
Result:

