The SWMC Wiki is currently under review.

RandomImage

From SWMC Wiki
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" /> <randomimage size="500" float="right" choices="Chris Sheppard cutting loose.jpg|Flash Harry 2.jpg|Si roof.jpg|Deborahs Bouldering.jpeg" />

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 <randomcaption> </randomcaption> 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.


<randomimage size="500" float="right" choices="Chris Sheppard cutting loose.jpg| Flash Harry 2.jpg| Si roof.jpg| Deborahs Bouldering.jpeg| Surplomb.jpg| Ultimatum.jpg| PICT0758.JPG| Hayabusa.jpg| The Gap2.jpg| Diamond Dog 5.jpg| Sirhowy.jpg| Waun lefrith.jpg| Barland quarry climbing.jpg" />