We continue to develop resources related to the COVID-19 pandemic. See COVID-19 initiatives on Appropedia for more information.

Template:Random portal component

From Appropedia
Jump to navigation Jump to search
[view] [edit] [history] [purge] Documentation icon Template documentation

This template generates a box for a portal home page. The content is drawn randomly from a pre-defined list.


{{Random portal component
 |max                 =
 |header              =
 |footer              =
 |subpage             = 
 |seed                =
 |rootpage            =
 |subpageroot         =
 |titleforegroundlink =
 |SPAN                =
 |TOC                 =
 |EDIT                =
 |noedit              =
 |nowatch             =


  • header: (optional) The header text of the box. If no header is passed to the template, the default is the subpage name.
  • footer: (optional) The footer text in the box. e.g Nominations for selected picture
  • rootpage: (optional) The root of the transcluded page, e.g. Portal:Foo
  • subpageroot: (optional) The root of the transcluded subpage when it is different than the box-header rootpage, default = rootpage. Good for transcluding the same source content to pages with different box-header styles.
  • subpage: The subpage of the transcluded page, e.g. Selected picture
  • max: The maximum number of sub-subpages. Must be a positive integer.
  • titleforegroundlink: (optional) The color of the "edit watch" links, default = black.
  • SPAN: (optional) Prevents box header title from appearing in page's table of contents.
  • TOC: (optional) Allows page to show a table of contents.
  • EDIT: (optional) Allows section edit links to appear on page.
  • noedit: (optional) Hides subpage edit link in box header.
  • nowatch: (optional) Hides subpage watch link in box header.
  • seed: (optional) The default seed is 17 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.

Formatting subpages

  • Create a sub-page first. If your portal is Portal:Foo, then a sub-page could be Portal:Foo/Selected bar;
  • On the Portal:Foo/Selected bar sub-page, place the template {{numbered subpages}} on the page and save it. The template will default to 50 subject sub-pages, however you can also use {{25 Numbered subpages}} or {{75 Numbered subpages}} for more or less sub-pages;
  • Once the list of subject links have been created, use one of the Selected subject templates from below to format each of the subject sub-pages.
  • This template calls /box-header and /box-footer for it's color styles and closing, consequently - these must be present in your portal design for it to work correctly.


To see a real time example, see what links here.

See also

This page or section includes content from Wikipedia. The original article was at Template:Random portal component. The list of authors can be seen in the history for that page. As with Appropedia, the text of Wikipedia is available under the CC-BY-SA.