模板:Random portal component
此模板的文档不存在、不全面或不能详细描述其功能及/或其代码中的参数。请帮助扩充并改进其文档。 |
此模板使用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.
Box-header/10
for Template:Box-header/10; default is the portal's/box-header
subpage
Formatting subpages
- Create a sub-page first. If your portal is
Portal:Foo
, then a sub-page could bePortal:Foo/Selected bar
. - On the
Portal:Foo/Selected bar
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
Selected <subject>
templates from below to format each of the subject sub-pages. - This template calls
/box-header
(ifheadertemplate
is not specified) and {{box-footer}} for its color styles and closing. Eitherheadertemplate
must be used, or the/box-header
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
本文为测试文字。这段文字用于说明格式,请勿删除。这段文字用于说明格式,请勿删除。海纳百川,有容乃大。维基百科,自由的百科全书。
See also
主题内容模板
- {{Box portal skeleton}}—用于创建专题页面的主页面。
- 在主题首页展示“精选内容”
- {{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 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}}—transcludes random portal subpages.
- {{Portal pictures}}—transcludes a slideshow of pictures, utilizing a single-page gallery.
- To organize "selected content" on subpages
- {{Subpage}}—Used to output a box containing a link to subpage.
- {{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.
主题页面格式模板
- {{Box-header}}
- {{Box-header-plain}}
- {{Box-header-round}}
- {{Box-header-square}}
- {{Box-header-watch}}
- {{Box-footer}}
设置连结的模板
- {{Portal}}
- {{Portal bar}}
- {{Portal-inline}}
- {{Portals}}
- {{Portal-image}}
- {{Portals browsebar}}
- {{Related portals}}
- {{Related portals2}}
- {{Wikimedia for 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}}
相关模板
- {{Project template list}}
- {{Random box-header subpage}}—randomized selection from {{Box-header/1}} to {{Box-header/42}}.