Template:Random subpage
Jump to navigation
Jump to search
This template is used on many pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
This template uses Lua: |
Template layout
{{Random subpage}}
or
{{Random subpage|page=<page name>|start=<number>|end=<number>|same=<number>}}
or
{{Random subpage|<page name>|<number>|<number>|<number>}}
Usage
This template transcludes a numbered sub-page that is randomly selected between the "start"-numbered sub-page and the "end"-numbered sub-page as follows:
{{<page name>/<randomly selected number between "start" and "end">}}
It may be used with or without parameters as follows:
- 1 or page: The name of the page to be displayed (without the subpage number). The default is empty.
- 2 or start: The starting sub-subpage number. Must be a positive integer. The default is 1.
- 3 or end: The ending sub-subpage number. Must be a positive integer. The default is 2.
- 4 or same: (optional) This parameter makes different template invocations link to the same subpage. It can be set with
|same=yes
,|same=y
,|same=true
or|same=1
. For it to work, the|same=
parameter must be set on all desired templates on a page, and those templates must also use the samestart
andend
values. The subpage chosen will change randomly if the page is edited or purged.
Note: this template used to accept a |seed=
parameter, but this has been deprecated after the template was switched to use Module:Random.
Example
This template can be used to display a list of randomly selected items from a group of numbered subpages.
{{Random subpage|page=Main Page/Selected articles|start=1|end=92}}