Template:Random page in category
This template creates a link to random page from a category.
Usage
- First parameter is the category from which to get a random page. If it is not specified, it defaults to current page, which works only on category pages.
- Parameter
|ns=is for specifying the namespace number. Separate multiple namespace numbers with;or!(e.g.|ns=2;118) - Parameter
|type=specified the type of page to return (page,subcat, orfile).|type=page,|type=subcat, and|type=fileare equivalent to|ns=0,|ns=14, and|ns=6, respectively. - Parameter
|action=specifies an action to perform on the page (e.g.|action=edit). See Parameters to index.php§Actions. - Parameter
|text=is for specifying different link text.
TemplateData
<templatedata> { "params": { "1": { "label": "Category", "description": "Category from which page will be selected", "type": "wiki-page-name" }, "ns": { "label": "Namespace" }, "type": {}, "action": {}, "text": {} } } </templatedata>
Examples
- REDIRECT Template:Template link code would produce on Category:Physics: Random page in category Physics
- REDIRECT Template:Template link code produces: Random page in category Physics
- REDIRECT Template:Template link code produces: Random page
- REDIRECT Template:Template link code produces: Random page in category Pending AfC submissions
- REDIRECT Template:Template link code produces: Random category in category States of the United States
- REDIRECT Template:Template link code produces: Random file in category Featured pictures
- REDIRECT Template:Template link code produces: Edit an article about a primary color
See also
- Random page in category on toolserver – the tool this template is based upon
| The above documentation is transcluded from Template:Random page in category/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |