Difference between revisions of "Template:Random page in category/doc"

From Second Life Wiki
Jump to navigation Jump to search
(Shamelessly copied from wikipedia.org and adapted for SL Wiki)
 
m (Missed one Wikipedia link...)
 
Line 8: Line 8:
=== Usage ===
=== 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.
* 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 {{Para|ns}} is for specifying the [[Wikipedia:Namespace|namespace number]]. Separate multiple namespace numbers with <code>;</code> or <code>!</code> (e.g. {{Para|ns|2;118}})
* Parameter {{Para|ns}} is for specifying the {{Wikipedia|Wikipedia:Namespace|namespace number}}. Separate multiple namespace numbers with <code>;</code> or <code>!</code> (e.g. {{Para|ns|2;118}})
* Parameter {{Para|type}} specified the type of page to return (<code>page</code>, <code>subcat</code>, or <code>file</code>). {{Para|type|page}}, {{Para|type|subcat}}, and {{Para|type|file}} are equivalent to {{Para|ns|0}}, {{Para|ns|14}}, and {{Para|ns|6}}, respectively.
* Parameter {{Para|type}} specified the type of page to return (<code>page</code>, <code>subcat</code>, or <code>file</code>). {{Para|type|page}}, {{Para|type|subcat}}, and {{Para|type|file}} are equivalent to {{Para|ns|0}}, {{Para|ns|14}}, and {{Para|ns|6}}, respectively.
* Parameter {{Para|action}} specifies an action to perform on the page (e.g. {{Para|action|edit}}). See {{Wikipedia|:mw:Manual:Parameters to index.php#Actions|Parameters to index.php§Actions}}.
* Parameter {{Para|action}} specifies an action to perform on the page (e.g. {{Para|action|edit}}). See {{Wikipedia|:mw:Manual:Parameters to index.php#Actions|Parameters to index.php§Actions}}.

Latest revision as of 08:47, 4 September 2023

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 "Wikipedia logo"namespace number. Separate multiple namespace numbers with ; or ! (e.g. |ns = 2;118)
  • Parameter |type = specified the type of page to return (page, subcat, or file). |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 "Wikipedia logo" [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 "Wikipedia logo"TemplateData for this template used by TemplateWizard, "Wikipedia logo"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

See also

toolforge:RandomInCategory Random page in category on toolserver] – the tool this template is based upon