跳转到内容

Template:Box-header/doc

维基教科书,自由的教学读本

用途

A template standardizing the portal templates and for other purposes.

語法

The template is not a stand-alone template and so once the box header is typed or pasted the template Box-footer must immediately follow it.

This example assumes that you have a separate page containing the content, and transclude it onto the page.

{{Box-header
| title= 
| editpage=  <!-- This data must be the same  -->
| titleforeground=
| titlebackground=
| background=
| viewpage= <!-- This data must be the same  -->
}}

{{ <!-- This data must be the same --> }}

{{Box-footer | text }}

This example assumes that the content is entered between the header and footer. Notice that viewpage is not in there. It will not work because it links to the page you are on, and therefore Wikipedia does not link it.

{{Box-header
| title= 
| editpage=  <!-- This field must be the same as the name of the page it is on. -->
| titleforeground=
| titlebackground=
| background=
}}

Box Content

{{Box-footer | text }}

範例

{{Box-header
| title= The Quotes of Quotes
| editpage= Box-header/sample
| titleforeground= white 
| titlebackground= red
| background= white
}}

{{Box-header/sample}}

{{Box-footer| [[William Shakespeare|more...]] }}

The Quotes of Quotes

Template:Box-header/sample

Template:Box-footer

Primary parameters

  • editpage – by default, the "edit" link applies to the page named Template:Box-header/doc/. Use this parameter to specify a different page to edit. This will normally be the page where the {{Box-header}} is used.
  • noedit – by default, an "edit" link is shown towards the right-hand side. Specify |noedit=yes (or any non-blank value) to hide this. The "edit" link is also hidden if |EDITLINK= is non-blank.
  • section – by default, the "edit" link applies to the whole page. Use this parameter to specify the number of a specific section, e.g. |section=2
  • title – the title of the box, for example |title=Portals
  • top – extra text to display after the "edit" and "view" links. Hidden if |EDITLINK= is non-blank.
  • viewpage – if non-blank, this should be a valid Wikipedia page name, it creates a "view" link after the "edit" link. Hidden if |EDITLINK= is non-blank.

Behaviour options

  • EDIT – by default, all section edit links are suppressed. Set |EDIT=yes (or any non-blank value) to override this.
  • EDITLINK – set |EDITLINK=no (or any non-blank value) to hide the "edit" and "view" links, and the text after those
  • SPAN – by default, the box title is enclosed in <h2>...</h2> tags. Set |SPAN=yes (or any non-blank value) to use <span>...</span> tags instead.
  • TOC – by default, the table of contents is suppressed. Set |TOC=yes (or any non-blank value) to override this.

Styling options

  • background
  • background-opacity
  • border
  • border-top
  • border-type
  • border-width
  • extra
  • font-family
  • font-size
  • foreground
  • padding
  • padding-top
  • padding-left
  • padding-right
  • padding-bottom
  • text-align
  • title-align
  • titlebackground
  • titleborder
  • title-font-family
  • title-font-size
  • titlefont-size
  • title-font-weight
  • titleforeground

These are all used to set CSS styling properties, in many cases the property of the same name – for instance, |background= is used to set the 'background' property.

See also

Box-footer

Box-header color palettes

The following box-headers are examples of HSV color palettes arranged by hue. They can be copied to your portal's /box-header subpage.

Border: Hn/S15/V75 • Background: Hn/S4/V100 • Header 1: Hn/S40/V85 • Header 2: Hn/S15/V95 • Header 3: Hn/S10/V100

H0

Template:Box-header/1

{{Box-header{{{watch|}}} | title={{{1}}} 
|editpage={{{2}}} 
|border=#BFA3A3            <!-- 邊框的顏色 -->
|titleforeground=black     <!-- 標題字的顏色 -->
|titlebackground=#F2CECE   <!-- 標題背景的顏色 -->
|background=#FFF5F5        <!-- 內文背景的顏色 -->
|foreground=black}}        <!-- 內文字的顏色 -->

{{Box-footer|{{{1|}}}}}

Template:Box-header/1

Template:Box-footer

Template:Box-header/2 Template:Box-header/2 Template:Box-footer

Template:Box-header/3 Template:Box-header/3 Template:Box-footer

H30

Template:Box-header/4 Template:Box-header/4 Template:Box-footer

Template:Box-header/5 Template:Box-header/5 Template:Box-footer

Template:Box-header/6 Template:Box-header/6 Template:Box-footer

H60

Border: H60/S15/V75 • Background: H60/S4/V100 • Header 1: H60/S40/V100 • Header 2: H60/S15/V100 • Header 3: H60/S10/V100

Template:Box-header/7 Template:Box-header/7 Template:Box-footer

Template:Box-header/8 Template:Box-header/8 Template:Box-footer

Template:Box-header/9 Template:Box-header/9 Template:Box-footer

H60

Template:Box-header/10 Template:Box-header/10 Template:Box-footer

Template:Box-header/11 Template:Box-header/11 Template:Box-footer

Template:Box-header/12 Template:Box-header/12 Template:Box-footer

H90

Template:Box-header/13 Template:Box-header/13 Template:Box-footer

Template:Box-header/14 Template:Box-header/14 Template:Box-footer

Template:Box-header/15 Template:Box-header/15 Template:Box-footer

H120

Template:Box-header/16 Template:Box-header/16 Template:Box-footer

Template:Box-header/17 Template:Box-header/17 Template:Box-footer

Template:Box-header/18 Template:Box-header/18 Template:Box-footer

H150

Template:Box-header/19 Template:Box-header/19 Template:Box-footer

Template:Box-header/20 Template:Box-header/20 Template:Box-footer

Template:Box-header/21 Template:Box-header/21 Template:Box-footer

H180

Template:Box-header/22 Template:Box-header/22 Template:Box-footer

Template:Box-header/23 Template:Box-header/23 Template:Box-footer

Template:Box-header/24 Template:Box-header/24 Template:Box-footer

H210

Template:Box-header/25 Template:Box-header/25 Template:Box-footer

Template:Box-header/26 Template:Box-header/26 Template:Box-footer

Template:Box-header/27 Template:Box-header/27 Template:Box-footer

H240

Template:Box-header/28 Template:Box-header/28 Template:Box-footer

Template:Box-header/29 Template:Box-header/29 Template:Box-footer

Template:Box-header/30 Template:Box-header/30 Template:Box-footer

H270

Template:Box-header/31 Template:Box-header/31 Template:Box-footer

Template:Box-header/32 Template:Box-header/32 Template:Box-footer

Template:Box-header/33 Template:Box-header/33 Template:Box-footer

H300

Template:Box-header/34 Template:Box-header/34 Template:Box-footer

Template:Box-header/35 Template:Box-header/35 Template:Box-footer

Template:Box-header/36 Template:Box-header/36 Template:Box-footer

H330

Template:Box-header/37 Template:Box-header/37 Template:Box-footer

Template:Box-header/38 Template:Box-header/38 Template:Box-footer

Template:Box-header/39 Template:Box-header/39 Template:Box-footer

H0 S0

Border: H0/S0/V75 • Background: H0/S0/V100 • Header 1: H0/S0/V75 • Header 2: H0/S0/V85 • Header 3: H0/S0/V95

Template:Box-header/40 Template:Box-header/40 Template:Box-footer

Template:Box-header/41 Template:Box-header/41 Template:Box-footer

Template:Box-header/42 Template:Box-header/42 Template:Box-footer

这是用于新版可视化编辑器及其他工具的模板数据文档。

Box-header模板数据

无描述。

模板参数

参数描述类型状态
Border-typeborder-type

无描述

未知可选
Titlebordertitleborder

无描述

未知可选
Borderborder

无描述

未知可选
Border-topborder-top

无描述

未知可选
Border-widthborder-width

无描述

未知可选
Titlebackgroundtitlebackground

无描述

未知可选
Titleforegroundtitleforeground

无描述

未知可选
Paddingpadding

无描述

未知可选
Padding-toppadding-top

无描述

未知可选
Padding-leftpadding-left

无描述

未知可选
Padding-rightpadding-right

无描述

未知可选
Padding-bottompadding-bottom

无描述

未知可选
Title-aligntitle-align

无描述

未知可选
Font-familyfont-family

无描述

未知可选
Titlefont-sizetitlefont-size

无描述

未知可选
EDITLINKEDITLINK

无描述

未知可选
Font-sizefont-size

无描述

未知可选
Noeditnoedit

无描述

未知可选
Editpageeditpage

无描述

未知可选
Sectionsection

无描述

未知可选
Viewpageviewpage

无描述

未知可选
Toptop

无描述

未知可选
SPANSPAN

无描述

未知可选
Title-font-familytitle-font-family

无描述

未知可选
Title-font-sizetitle-font-size

无描述

未知可选
Title-font-weighttitle-font-weight

无描述

未知可选
Extraextra

无描述

未知可选
Titletitle

无描述

未知必需
Backgroundbackground

无描述

未知可选
Background-opacitybackground-opacity

无描述

未知可选
Foregroundforeground

无描述

未知可选
Text-aligntext-align

无描述

未知可选
TOCTOC

无描述

未知可选
EDITEDIT

无描述

未知可选

See also

Template:Portal template list