Template:Random page in category
(Redirected from Template:RPC)
Jump to navigation
Jump to search
This documentation is transcluded from Template:Random page in category/doc. (Edit | history)
Note to editors: Please don't categorize this template by editing it directly. Instead, place the category in its documentation page, in its "includeonly" section.
Note to editors: Please don't categorize this template by editing it directly. Instead, place the category in its documentation page, in its "includeonly" section.
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 = file are 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 [https://en.wikipedia.org/wiki/
- mw:Manual:Parameters_to_index.php%23Actions Parameters to index.php§Actions].
- Parameter |text = is for specifying different link text.
TemplateData
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. Click here to see a monthly parameter usage report for this template based on this TemplateData.
TemplateData for Random page in category
{
"params": {
"1": {
"label": "Category",
"description": "Category from which page will be selected",
"type": "wiki-page-name"
},
"ns": {
"label": "Namespace"
},
"type": {},
"action": {},
"text": {}
}
}
Examples
{{Random page in category}}
would produce on Category:Physics: Random page in category Physics{{Random page in category|Physics}}
produces: Random page in category Physics{{Random page in category|Physics|text=Random page}}
produces: Random page{{Random page in category|Pending AfC submissions|ns=2;118|type=page}}
produces: Random page in category Pending AfC submissions{{Random page in category|States of the United States|type=subcat}}
produces: Random category in category States of the United States{{Random page in category|Featured pictures|type=file}}
produces: Random file in category Featured pictures{{Random page in category|Primary colors|action=edit|type=page|text=Edit an article about a primary color}}
produces: Edit an article about a primary color
See also
- toolforge:RandomInCategory Random page in category on toolserver] â the tool this template is based upon