Extension:RandomArea

Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:Creative Commons licensed extensions
MediaWiki extensions manual
RandomArea
Release status: betaCategory:Beta status extensions
Implementation Tag Category:Tag extensions
Description Inserting random elements in a page
Author(s) Thomas Stock
Latest version 2.0.0 (2018-03-29)
MediaWiki 1.29+Category:Extensions with manual MediaWiki version
Database changes No
License Creative Commons Attribution NonCommercial Share Alike 2.5
Download Category:Extensions in Wikimedia version control
Quarterly downloads 3 (Ranked 113rd)
Translate the RandomArea extension if it is available at translatewiki.net
Category:All extensions

The RandomArea extension allows for displaying or including a selected number of random elements from a list on a page.

Note: I was inspired by the RandomText extension to write this, thanks to Martin Rohrbach.

Installation

  • Download and move the extracted RandomArea folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/RandomArea
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'RandomArea' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage

Insert the lines you want to be randomized and enclosed in <randomArea>...</randomArea> tags; for example:

<randomArea >
Klaus
Mark
Otto
</randomArea>

Only displays one of the following names: {Klaus, Mark, Otto}

You can use this to include patterns or pages.

<randomArea >
{{Template:Aaa}}
{{:Patterns:Aab}}
</randomArea>

You can alternatively add some attributes to the element to save and view letters.

<randomArea include="1" nsPrefix="MyRandPrefix:" count="2" >
Klaus
Mark
Otto
</randomArea>

This chooses two of the elements and includes them from the given namespace. It is equivalent to:

<randomArea count="2" >
{{:MyRandPrefix:Klaus}}
{{:MyRandPrefix:Mark}}
{{:MyRandPrefix:Otto}}
</randomArea>
Category:Random content extensions
Category:All extensions Category:Beta status extensions Category:Creative Commons licensed extensions Category:Extensions in Wikimedia version control Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:Extensions without an image Category:ParserFirstCallInit extensions Category:Random content extensions Category:Tag extensions