Extension:RandomImage

The Random Image extension adds a  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.

Installation

 * 1) Obtain the latest version of the extension from Subversion and place all files in the extensions directory
 * 2) Add the line require_once( 'extensions/RandomImage.php' ); to your LocalSettings.php file
 * 3) Access Special:Version on your wiki and search for the corresponding entry to verify installation was successful

Inserting a random image
The tag supports two basic forms: In addition, both tags support two additional attributes; size and float. The default size is the user's thumbnail size. Provide a numerical value to override the size, e.g.
 * Single, i.e., which produces an image without a caption
 * Container, i.e., where text inside the tags is used as a caption



Float allows overriding the float direction.

Caching
By default, the output is cached in the regular parser cache. This can be advantageous on larger sites which need to use caching to reduce the effects of load, however, it means that content is not 100% dynamic.

To disable the parser cache on pages which use the  tag, set $wgRandomImageNoCache = true; in LocalSettings.php (after the call to include the extension file). This will affect all users, and might incur additional overhead on pageviews.