• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.154
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Random subpage

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:Random

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}}
  • {{Portals}}
  • {{Portals browsebar}}
  • {{Related portals}}
  • {{Related portals2}}
  • {{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}}
Portal.svg
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}}
  • {{Portal bar}}
  • {{Portal-inline}}11
  • {{Pbox}}
  • {{Related portals}}
  • {{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}}12
  • {{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-inline
  • 12 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 (create | mirror) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://moasspedia.org/w/index.php?title=Template:Random_subpage&oldid=28270"
Categories:
  • Lua-based templates
  • Wikipedia Portal templates
Last edited on 23 February 2018, at 12:02

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 23 February 2018, at 12:02.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop