Template:Message box: Difference between revisions
No edit summary |
m (13 revisions imported) |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{# | <div class="c-mbox {{#switch:{{{type|}}} | ||
| | |warning | ||
|action | |||
|content | |||
|style | |||
|info | |||
|proposal | |||
|lock | |||
|legal = c-mbox--{{{type}}} | |||
}} {{yesno|{{{full|}}}|yes=c-mbox--full}} {{{class|}}} {{#if:{{{style|}}}|style="{{{style}}}"}}"> | |||
{{#if:{{{image|}}}|<div class="c-mbox__image">{{#ifeq:{{#pos:{{{image}}}|{{!((}}File:}}|0|{{{image}}}|[[File:{{{image}}}|45px|link=]]}}</div>}} | |||
| | <div class="c-mbox__main"> | ||
{{#if:{{{title|<noinclude>1</noinclude>}}}| | |||
<div class="c-mbox__title"> | |||
{{{title}}} | |||
</div> | |||
}}{{#if:{{{text|<noinclude>1</noinclude>}}}| | |||
<div class="c-mbox__text"> | |||
{{{text}}} | |||
</div> | |||
}} | |||
</div> | |||
</div><noinclude> | |||
{{Documentation}} | |||
</noinclude> |
Latest revision as of 00:45, 23 September 2024
{{{title}}}
{{{text}}}
This template is used to create standardised message boxes. It is most often used as the base for various types of notice templates.
Usage
All parameters are optional.
{{Message box |type = |full = |class = |style = |image = |title = |text = }}
Parameters
Parameter | Description |
---|---|
type
|
Determines the colors of the message box. See § Type for details. |
full
|
Set this option to yes to expand the message box to the full width of the page. This is used primarily for editnotice templates.
|
class
|
Additional CSS classes applied to the message box |
style
|
Inline CSS styles applied to the message box |
image
|
If passed the name of an image file, it will be displayed as an icon with a standard width. If passed a file link, it will be displayed as given. |
title
|
The title displayed at the top of the message box |
text
|
The text displayed after the title |
Type
The type
parameter determines the colors of the message box.
Type | Example |
---|---|
warning
|
This is an example of a warning notice. This type of notice should only be used for warnings that demand editors' attention. |
action
|
This is an example of an action notice. This type of notice is used to convey critical information about actions that should be taken by editors. |
content
|
This is an example of a content notice. This type of notice is typically used to provide editing instructions about the contents of a page. |
style
|
This is an example of a style notice. This type of notice is typically used to provide editing notes related to style. |
info
|
This is an example of an info notice. This type of notice is used to convey important information to readers or editors. |
proposal
|
This is an example of a proposal notice. This type of notice is typically used for editing proposals. |
lock
|
This is an example of a lock notice. This type of notice can be used for edit protection and archival notices. It is sometimes also used to give readers historical context. |
legal
|
This is an example of a legal notice. This type of notice is typically used to display licensing and copyright information. |
(default) | This is an example of a generic notice. This type of notice can be used to provide readers or editors with supplementary information. |
Editors can experiment in this template's sandbox and testcases pages.
Please add categories to the /doc subpage. Subpages of this template.