模板:Msgbox
跳至導覽
跳至搜尋
This template displays a basic message box.
Usage
All parameters are optional.
{{msgbox | class = <css classes> | style/css = <css styles> | width = <box width> | image = <personal image choice> | imagesize = <image size> | imagelink = <image link> | imagetext = <image alt text> | imagealt = <completely custom image display> | discuss = y/yes | discusspage = <discuss page> | discussanchor <discuss section name> | title = <box title> | text = <box text> | nosnippet = n/no }}
參數 | 描述 | 類型 | 狀態 | |
---|---|---|---|---|
CSS class | class | Custom CSS class
| 單行文本 | 可選 |
CSS style | style css | 單行文本 | 可選 |
|
Background color | bgcol | Background color of the box
| 單行文本 | 棄用 see below |
Box width | width | Width of the box
| 單行文本 | 可選 |
Box image | image | Image that is displayed in the box on the left
| 文件 | 可選 |
Image size | imagesize | Size of the $image
| 單行文本 | 可選 |
Image link | imagelink | The page that $image will link to | 單行文本 | 可選 |
Image text | imagetext | Alt text for $image | 單行文本 | 可選 |
Custom image | imagealt | Completely custom image display; overrides $image and $imagesize | 不完整的wikitext | 可選 |
Discuss option | discuss | Adds a link to the current page's talk page (or $discusspage ); only has an effect if a $title is set | 布爾值 | 可選 |
Discuss link | discusspage | The page that $discuss will link to | 單行文本 | 可選 |
Discuss anchor | discussanchor | The section on the page that $discuss will link to | 單行文本 | 可選 |
Box title | title | Title of the box | 字符串 | 可選 |
Main text | text | Text inside the box | 不完整的wikitext | 推薦 |
HTML attribute "data-nosnippet" | nosnippet | Removes the data-nosnippet attribute from the box. It is added by default so that the box does not show up in the preview text of search engines.
| 布爾值 | 可選 |
Examples
For compatibility with wiki.gg's theme, hardcoded background/border colors should be avoided. Instead, use one of the predefined classes listed below, which are styled for the different themes.
Code | Result |
---|---|
{{msgbox|text=Message box text|class=msgbox-color-blue}}
|
|
{{msgbox|text=Message box text|class=msgbox-color-red}}
|
|
{{msgbox|text=Message box text|class=msgbox-color-purple}}
|
|
{{msgbox|text=Message box text|class=msgbox-color-green}}
|
|
{{msgbox|text=Message box text|class=msgbox-color-yellow}}
|
|
{{msgbox|text=Message box text|class=msgbox-color-orange}}
|
|
{{msgbox|text=Message box text|class=msgbox-color-pink}}
|
|
{{msgbox|text=Message box text}}
|