跳转到内容

Template:Random portal component/doc

维基百科,自由的百科全书

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 be Portal: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 (if headertemplate is not specified) and {{box-footer}} for its color styles and closing. Either headertemplate 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:

本文为測試文字。这段文字用于说明格式,请勿删除。這段文字用於說明格式,請勿刪除。海納百川,有容乃大。維基百科,自由的百科全書。

Footer

See also

主題内容模板

主題頁面格式模板

設置連結的模板

所選頁面模板,用於較舊門戶的子頁面

相關模板