• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Random subpage

  • Template
  • Talk
  • Language
  • Watch
  • View source
Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 7,600 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:
  • Module:Random (sandbox)

Contents

  • 1 Template layout
  • 2 Usage
    • 2.1 Example
  • 3 See also

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|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|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 same start and end 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. 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}}
{{Random subpage|page=Portal:Foo/Did you know|start=5|end=8}}
{{Random subpage|page=Portal:Foo/Did you know|start=9|end=12}}
{{Random subpage|page=Portal:Foo/Did you know|start=13|end=16}}

See also

This box:
  • view
  • talk
  • edit

Portal content templates

  • To display "selected content" on the portal main page
    • {{Transclude list item excerpts as random slideshow}}—transcludes excerpts from recognized content lists, which are populated by a bot.
    • {{Transclude random subpage}}—transcludes random portal subpage.
    • {{Random portal component}}—transcludes random portal subpage.
    • {{Random subpage}}—transcludes random portal subpages.
    • {{Portal pictures}}—transcludes a slideshow of pictures, utilizing a single-page gallery.
  • To organize "selected content" on subpages
    • {{Numbered subpages}}—outputs an automatic index, transcluding numbered subpages.
    • {{Portal subpage}}—outputs a box linking to and transcluding a single subpage.
    • {{Portal subpage inline}}—outputs an unordered list item linking to and transcluding a single subpage.

Main portal page formatting templates

  • {{Box-header}}
  • {{Box-header-plain}}
  • {{Box-header-round}}
  • {{Box-header-square}}
  • {{Box-header-watch}}
  • {{Box-footer}}

Templates that configure links

  • {{Portal}}
  • {{Portal bar}}
  • {{Portal-inline}}
  • {{Pbox}}
  • {{Portals}}
  • {{Portals browsebar}}
  • {{Related portals}}
  • {{Wikimedia for portals}}

Selected page templates, used on subpages of older portals

  • {{Selected article}}
  • {{Selected biography}}
  • {{Selected business}}
  • {{Selected DYK}}
  • {{Selected ingredient}}
  • {{Selected location}}
  • {{Selected picture}}
  • {{Selected product}}
  • {{Selected publication}}
  • {{Selected quote}}
  • {{Selected recipe}}
  • {{Selected X}}

Related templates

  • {{Project template list}}
  • v
  • t
  • e
Portal templates
Visual overview of template usage
Layout and formatting
  • {{Box portal skeleton}}
  • {{Box-header}}
    • color palettes
    • plain
    • round
    • square
    • watch
  • {{Box-header colour}}[1]
  • {{Box-footer}}
  • {{Flex columns}}
  • {{Plain navboxes}}
Content transclusion
  • {{Transclude lead excerpt}}[2]
  • {{Transclude linked excerpt}}[2]
  • {{Transclude list item excerpt}}[2]
  • {{Transclude random excerpt}}[2]
  • {{Transclude selected excerpt}}[2]
  • {{Excerpt}}
  • {{Transclude DYK}}[9]
  • {{Transclude selected current events}}[3]
  • {{Transclude selected recent additions}}[4]
Content slideshows
  • {{Random slideshow}}[5]
  • {{Transclude files as random slideshow}}[5]
  • {{Transclude excerpts as random slideshow}}[6]
  • {{Transclude linked excerpts as random slideshow}}[6]
  • {{Transclude list item excerpts as random slideshow}}[6]
Content randomisation
  • {{Random portal component}}[7]
  • {{Random quotation}}
  • {{Random subpage}}
General
  • {{Portals}}
  • {{Portals browsebar}}
  • {{Portal description}}
  • {{Portal information sidebar}}
  • {{Portal navbar no header2}}
  • {{Purge link portals}}
  • {{Wikimedia for portals}}
Linking templates
  • {{Portal}}[11]
  • {{Portal bar}}[12]
  • {{Portal-inline}}[13]
  • {{Pbox}}
  • {{Related portals2}}
Talk pages / Maintenance
  • {{Portal talk}}
  • {{Portal maintenance status}}[8]
  • {{Portal suggestions}}
  • {{Portal toolbox}}
  • {{WikiProject Portals}}[8]
Images
  • {{Portal dynamic image}}
  • {{Portal image banner}}[10]
  • {{Portal pictures}}[14]
  • {{Portal POTD}}
Modules
  • 1. Module:Box-header
  • 2. Module:Excerpt/portals
  • 3. Module:Selected current events
  • 4. Module:Selected recent additions
  • 5. Module:Random slideshow
  • 6. Module:Excerpt slideshow
  • 7. Module:Random portal component
  • 8. Module:Portal maintenance status
  • 9. Module:Transclude DYK
  • 10. Module:Portal image banner
  • 11. Module:Portal
  • 12. Module:Portal bar
  • 13. Module:Portal-inline
  • 14. Module:Portal pictures
Usage
  • Wikipedia:Portal
  • Wikipedia:WikiProject Portals
For more information, see: Category:Template-Class Portal pages and Category:Wikipedia Portal templates
The above documentation is transcluded from Template:Random subpage/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Random_subpage&oldid=827251120"
Last edited on 23 February 2018, at 17:02

Languages

    • العربية
    • অসমীয়া
    • تۆرکجه
    • বাংলা
    • 閩南語 / Bân-lâm-gí
    • Български
    • Bosanski
    • Cebuano
    • Čeština
    • Eesti
    • Ελληνικά
    • Español
    • فارسی
    • Føroyskt
    • 한국어
    • हिन्दी
    • Bahasa Indonesia
    • Italiano
    • کٲشُر
    • Қазақша
    • Kurdî
    • Lietuvių
    • Magyar
    • മലയാളം
    • मराठी
    • Bahasa Melayu
    • नेपाली
    • 日本語
    • ଓଡ଼ିଆ
    • Oʻzbekcha / ўзбекча
    • Português
    • Română
    • Русский
    • संस्कृतम्
    • Scots
    • සිංහල
    • Simple English
    • سنڌي
    • Slovenščina
    • کوردی
    • Српски / srpski
    • Svenska
    • တႆး
    • ไทย
    • Türkçe
    • Українська
    • اردو
    • Tiếng Việt
    • Zazaki
    • 中文
    • ꠍꠤꠟꠐꠤ
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 23 February 2018, at 17:02 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop