Extension:RandomArea
From MediaWiki.org
|
Release status: stable |
|
|---|---|
| Implementation | Tag |
| Description | Inserting random elements in a page |
| Author(s) | Thomas Stock |
| Last Version | 1.1 (2009-07-30) |
| MediaWiki | 1.6.5 and higher |
| License | CC by-nc-sa/2.5 |
| Download | Here |
|
check usage (experimental) |
|
Random Area is an extension written for MediaWiki that allows to display or include 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.
[edit] Installation
Download and store it to randomArea.php in your extensions folder. Note the extension in your LocalSettings.php like:
require("extensions/randomArea.php");
[edit] 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>
Or you can add some attributes to the element to save and view letters.
<randomArea include="1" nsPrefix="MyRandPrefix:" count="2" > Klaus Mark Otto </randomArea>
Chooses two of the elements and includes them from the given namespace. And is equivalent to:
<randomArea count="2" >
{{:MyRandPrefix:Klaus}}
{{:MyRandPrefix:Mark}}
{{:MyRandPrefix:Otto}}
</randomArea>
[edit] See also
- RandomText for more information about caching tricks
- Source Page