සැකිල්ල:Random subpage
Appearance
This template employs intricate features of template syntax.
You are encouraged to familiarise yourself with its setup and parser functions before editing the template. If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages. Remember that you can conduct experiments, and should test all improvements, in either the general Template sandbox or your user space before changing anything here. |
Template layout
[සංස්කරණය]{{Random subpage}} or {{Random subpage|page=<page name>|start=<number>|end=<number>|seed=<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|page: The name of the page to be displayed (without the subpage number). The default is empty.
- 2|start: The starting sub-subpage number. Must be a positive integer. The default is 1.
- 3|end: The ending sub-subpage number. Must be a positive integer. The default is 2.
- 4|seed: (optional) The default seed is 2 and can be set to any other integer value (used to generate distinct values on the same page). Prime numbers work best, such as 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, and 113.
Example
[සංස්කරණය]This template can be used to display a list of randomly selected items from a group of numbered subpages. For example, portals that use "Did you know..." sections can randomly display four items from a page named "Portal:Foo/Did you know" that has sixteen numbered subpages as follows:
{{Random subpage|page=Portal:Foo/Did you know|start=1|end=4|seed=2}} {{Random subpage|page=Portal:Foo/Did you know|start=5|end=8|seed=3}} {{Random subpage|page=Portal:Foo/Did you know|start=9|end=12|seed=5}} {{Random subpage|page=Portal:Foo/Did you know|start=13|end=16|seed=7}}
See also
[සංස්කරණය]Main portal creation templates
- {{Basic portal start page}}—Used to create portal main pages.
- {{Random portal component}}—Used on the portal main page to randomly display articles from the portal sub-pages.
- {{Random portal component with nominate}}—Used on the portal main page to randomly display articles from the portal sub-pages, adding the option to nominate other Featured foo articles.
- {{Random subpage}}—Used on the portal main page to randomly display articles from the portal sub-pages. This template is best used for creating randomly populated Did you know... sections on the portal main page that are intended to include multiple Did you know... facts.
- {{Subpage}}—Used to output a box containing a link to subpage.
- {{Numbered subpages}}—Used to create article links on portal sub-pages with 50 links.
- {{Numbered subpages|max=25}}—As hereinbefore, but with 25 links.
- {{Numbered subpages|max=75}}—As hereinbefore, but with 75 links.
- {{Numbered subpages|max=100}}—As hereinbefore, but with 100 links.
- {{Random box-header subpage}}—Used to transclude a numbered subpage.
Main portal page formatting templates
- {{Box-header}}
- {{Box-header-blank}}
- {{Box-header-plain}}
- {{Box-header-round}}
- {{Box-header-square}}
- {{Box-header-watch}}
- {{Box-footer}}
Templates that configure links
- {{Portal}}
- {{Portal bar}}
- {{Portal-inline}}
- {{Portals}}
- {{Portal-image}}
- {{Portals browsebar}}
- {{Related portals}}
- {{Related portals2}}
- {{Wikimedia for portals}}
These templates are used to format the articles on the sub-pages
{{Selected X}}—Generic template for situations not listed hereafter.
- {{Selected article}}
- {{Selected biography}}
- {{Selected business}}
- {{Selected DYK}}
- {{Selected ingredient}}
- {{Selected location}}
- {{Selected picture}}
- {{Selected product}}
- {{Selected publication}}
- {{Selected quote}}
- {{Selected recipe}}
Related templates