Extension:RandomArea
RandomArea Release status: beta |
|
---|---|
Implementation | Tag |
Description | Inserting random elements in a page |
Author(s) | Thomas Stock |
Latest version | 2.0.0 (2018-03-29) |
MediaWiki | 1.29+ |
Database changes | No |
License | Creative Commons Attribution NonCommercial Share Alike 2.5 |
Download | |
Quarterly downloads | 0 |
Translate the RandomArea extension if it is available at translatewiki.net | |
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
edit- Download and move the extracted
RandomArea
folder to yourextensions/
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' );
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage
editInsert 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>