Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Random/doc
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== List == The <code>list</code> function outputs a list in a random order. {{#invoke:random|list|''list item 1''|''list item 2''|''list item 3''|...|sep=''separator''|limit=''number of items to display''|same=''yes''}} '''Named parameters''' * {{para|sep}} or {{para|separator}} - an optional separator for the list items. Some values are special; see the table below. * {{para|limit}} - the maximum number of list items to display. The lowest possible is 0 and the highest possible is the length of the list. * {{para|same}} - if this is set to "yes", "y", "true", or "1", the list order is the same for each module call on a given page. {| class="wikitable" |+ Possible separator values |- ! Code !! Output |- | <code>dot</code> || {{int:dot-separator}} |- | <code>pipe</code> || {{int:pipe-separator}} |- | <code>comma</code> || {{int:comma-separator}} |- | <code>tpt-languages</code> || {{int:tpt-languages-separator}} |- | <code>space</code> || ''a space'' |- | <code>newline</code> || ''a newline character'' |- | ''any other value'' || ''other values are used without modification'' |} You cannot input spaces directly to the {{para|sep}} parameter due to limitations in MediaWiki's template syntax. However, it is possible to work around this by using [[HTML entities]]. You can use <code>&#32;</code> to represent a normal space, and <code>&nbsp;</code> to represent a [[non-breaking space]]. '''Examples''' <small>({{purge|refresh|anchor=List}})</small> * <code><nowiki>{{#invoke:random|list|egg|beans|sausage|bacon|spam}}</nowiki></code> → {{#invoke:random|list|egg|beans|sausage|bacon|spam}} * <code><nowiki>{{#invoke:random|list|egg|beans|sausage|bacon|spam|sep=dot}}</nowiki></code> → {{#invoke:random|list|egg|beans|sausage|bacon|spam|sep=dot}} * <code><nowiki>{{#invoke:random|list|egg|beans|sausage|bacon|spam|sep=space}}</nowiki></code> → {{#invoke:random|list|egg|beans|sausage|bacon|spam|sep=space}} * <code><nowiki>{{#invoke:random|list|egg|beans|sausage|bacon|spam|sep=;&#32;}}</nowiki></code> → {{#invoke:random|list|egg|beans|sausage|bacon|spam|sep=; }} * <code><nowiki>{{#invoke:random|list|egg|beans|sausage|bacon|spam|sep=foo}}</nowiki></code> → {{#invoke:random|list|egg|beans|sausage|bacon|spam|sep=foo}} * <code><nowiki>{{#invoke:random|list|egg|beans|sausage|bacon|spam|limit=3}}</nowiki></code> → {{#invoke:random|list|egg|beans|sausage|bacon|spam|limit=3}} * <code><nowiki>{{#invoke:random|list|egg|beans|sausage|bacon|spam|same=yes}}</nowiki></code> → {{#invoke:random|list|egg|beans|sausage|bacon|spam|same=yes}} * <code><nowiki>{{#invoke:random|list|egg|beans|sausage|bacon|spam|same=yes}}</nowiki></code> → {{#invoke:random|list|egg|beans|sausage|bacon|spam|same=yes}}
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)