community
This extension is enabled by default on Fandom.

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

Step by step

Syntax

The extension brings the following set of tags to customize your own random selection:

It also brings a parser function called #choose, which accepts links, images, and even templates. Used as:

{{#choose:
 |Option 1
 |Option 2
 |More options...
}}

Examples

Basic usage is like this:

<choose>
 <option>Option 1</option>
 <option>Option 2</option>
</choose>

It's also possible to use the before and after attributes of the <choose> tag to add random videos, using EmbedVideo for example (where VideoIDn is a Youtube video ID):

<choose before="{{#ev:youtube|" after="}}">
 <option>VideoID1</option>
 <option>VideoID2</option>
 <option>VideoID3</option>
</choose>

The example below will display a flag image icon:

<choose>
 <option>[[File:Icon-German.png|18px]]</option>
 <option>[[File:Icon-English.png|18px]]</option>
 <option>[[File:Icon-Spanish.png|18px]]</option>
 <option>[[File:Icon-Finnish.png|18px]]</option>
 <option>[[File:Icon-French.png|18px]]</option>
 <option>[[File:Icon-Italian.png|18px]]</option>
 <option>[[File:Icon-Japanese.png|18px]]</option>
 <option>[[File:Icon-Korean.png|18px]]</option>
 <option>[[File:Icon-Dutch.png|18px]]</option>
 <option>[[File:Icon-Polish.png|18px]]</option>
 <option>[[File:Icon-Portuguese.png|18px]]</option>
 <option>[[File:Icon-Russian.png|18px]]</option>
 <option>[[File:Icon-Vietnamese.png|18px]]</option>
 <option>[[File:Icon-Chinese.png|18px]]</option>
</choose>

The above example results in the following:

Icon-Dutch

See also

Further help and feedback