RandomImage

From SWMC Guidebook

Jump to: navigation, search

Overview

The Random Image extension adds a <randomimage> tag to the MediaWiki parser which allows for randomisation of multimedia content on a page.

When the tag is rendered, a random image is selected from those uploaded and inserted at the location of the tag. Users can select a custom size, float and provide a caption for the resulting image; captions can also be pulled from the image description page.

Use

The tag can be used in two forms:

<randomimage /> Produces an image using an automatic caption (see below) <randomimage></randomimage> Produces an image with a preset caption (text inside the tags) The tag also supports the following attributes:

size
Set the image width (default is the user's thumbnail width)

float
Float the image; valid values are 'left', 'center' and 'right'

choices
Confines image selection to a pipe-delimited list of images

For example: <randomimage size="500" float="right" choices="Chris Sheppard cutting loose.jpg|Flash Harry 2.jpg|Si roof.jpg|Deborahs Bouldering.jpeg" />

Gareth Tucker bouldering at Deborah's Overhang


Caption

If no caption is specified, one will be pulled, if possible, from the image description page.

Check the source (edit) to read the next paragraph.

If the description page contains text wrapped in tags, then this will be used as the caption. The tags are ignored during normal page views. Otherwise, the first paragraph of the page text will be used as the caption.


Dan Cook on Miss You, 6B+, Barland Quarry
Personal tools
Namespaces
Variants
Actions
External
Toolbox
Print/export