Extension:RandomSelection

The RandomSelection extension allows for randomly-generated content inside your wiki; e.g. rotating images, random greetings, etc.

Usage
To choose between one or more options, simply place each option inside an tag, like so:

This is the first choice. This is the second choice. And so on...

From each set of tags, precisely one tag will be selected at random, and its contents shown.

If you'd like some options to be shown more often than others, you can add weight to the option tags, like so:

This option will be shown twice as often as a normal option.

By default, options have a weight of 1.

This option also has a weight of 1. Fractional portions are ignored.

Anything can be placed inside of option tags: links, images, even templates. Note, however, that template arguments will not be expanded due to 2257.

Code
The code in this page will only work in MediaWiki 1.7 and above. ([ Alternate version for 1.5 and above])


 * Dec 10 07 -- Updated for compatibility with MW 1.12's new parser model
 * Feb 23 08 -- Minor bugfix
 * May 8 08 -- Bugfix