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) Check out all extension files from Subversion and place them in a RandomImage subdirectory within your MediaWiki extensions directory
 * 2) Add the line   to your LocalSettings.php file

Installation can be verified through the Special:Version page on the wiki.

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.