Template:Random portal component/doc
This is a documentation subpage for Template:Random portal component. It may contain usage information, categories and other content that is not part of the original template page. |
This template uses Lua: |
This template generates a box for a portal home page. The content is drawn randomly from a pre-defined list.
Layout
{{Random portal component |max = |template = |header = |footer = |subpage = |rootpage = |headertemplate = }}
Usage
- 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.
- subpage: The subpage of the transcluded page, e.g. Selected picture.
- max: The maximum number of sub-subpages. Must be a positive integer.
- headertemplate: (Optional) The name of the template to use for the box header, e.g. <syntaxhighlight lang="text" class="" id="" style="" inline="1">Box-header/10</syntaxhighlight> for Template:Box-header/10; default is the portal's <syntaxhighlight lang="text" class="" id="" style="" inline="1">/box-header</syntaxhighlight> subpage
Formatting subpages
- Create a sub-page first. If your portal is <syntaxhighlight lang="text" class="" id="" style="" inline="1">Portal:Foo</syntaxhighlight>, then a sub-page could be <syntaxhighlight lang="text" class="" id="" style="" inline="1">Portal:Foo/Selected bar</syntaxhighlight>.
- On the <syntaxhighlight lang="text" class="" id="" style="" inline="1">Portal:Foo/Selected bar</syntaxhighlight> sub-page, place the template {{numbered subpages}} on the page and save it.
- Once the list of subject links have been created, use one of the <syntaxhighlight lang="text" class="" id="" style="" inline="1">Selected <subject></syntaxhighlight> templates from below to format each of the subject sub-pages.
- This template calls <syntaxhighlight lang="text" class="" id="" style="" inline="1">/box-header</syntaxhighlight> (if <syntaxhighlight lang="text" class="" id="" style="" inline="1">headertemplate</syntaxhighlight> is not specified) and {{box-footer}} for its color styles and closing. Either <syntaxhighlight lang="text" class="" id="" style="" inline="1">headertemplate</syntaxhighlight> must be used, or the <syntaxhighlight lang="text" class="" id="" style="" inline="1">/box-header</syntaxhighlight> subpage must exist for everything to work correctly.
Example
To see a real time example, see what links here (the list of pages that currently transclude the {{Random portal component}} template).
Here is a stale example of the output generated by this template.
{{Box-header | title=Header |editpage = Template:Lorem ipsum |border = Black |titleforeground = #ffe247 |titlebackground = #646464 |background = #FFFFFF |foreground = black }} {{Lorem ipsum}} {{Box-footer | Footer }}
will produce:
Header
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
See also
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.
- 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}}
- {{Portal-image}}
- {{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}}
- {{Basic portal start page}} (deleted)—Used to create portal main pages.
- {{Random box-header subpage}}—randomized selection from {{Box-header/1}} to {{Box-header/42}}.