The Message droplet inserts a message box into a page. A message box highlights information, for example a note, a tip, or a warning. Each box type has its own colors and icon. The droplet is based on Template:Textbox.
For more information about inserting content droplets, refer to Content Droplets.
Insert a message box
To insert a message box in VisualEditor:
- Search for a content droplet Message.
- Select a Message droplet and select Insert. A dialog opens.
- Set the parameters in the dialog:
- Show icon: Select the checkbox to show the icon of the box type.
- Box Type: Choose the type of the box: Success message, Warning message, Important message, Note, Tip, or Message.
- Headline: Enter a header for the box. The header is optional.
- Text: Enter the content of the box. To format the text, use wikitext, for example
'''bold'''or''italic''.
- Select Insert. The message box appears on the page.
Parameters
The following table lists the dialog fields and the corresponding template parameters:
| Parameter | Template parameter | Description |
|---|---|---|
| Show icon | icon
|
Shows the icon of the box type. Allowed value in wikitext: yes. If the parameter is empty, the box has no icon.
|
| Box Type | boxtype
|
Determines the type of the box. Each type has its own border color, background color, and icon.
Allowed values in wikitext (case-sensitive): The colors are defined in |
| Headline | header
|
Shows a bold header above the text. The parameter is optional. If the parameter is empty, the box has no header. |
| Text | text
|
Sets the content of the box. The parameter accepts wikitext. |
To insert a message box in wikitext, use the following syntax:
{{Textbox
|boxtype = note
|icon = yes
|header = Note
|text = Text of the message box.
}}
Adjust the alignment
This section is intended for administrators.
Template:Textbox is a standard system template. The template and its style sheet Template:Textbox/styles.css are maintained centrally in the shared resources wiki. Changes in the shared resources wiki affect the Message droplet in all subwikis.
To change the template for a single subwiki only, copy the template to the subwiki and make the changes there. Changes to the copy affect only this subwiki.
By default, a message box spans the full width of the page. If an image appears directly before the box, the box is displayed below the image. The declaration clear:both in the .cd-textbox selector causes this behavior.
To display the box within the text flow in a single subwiki:
- Copy
Template:TextboxandTemplate:Textbox/styles.cssfrom the shared resources wiki to the subwiki. - In the subwiki, open the page
Template:Textbox/styles.cssfor editing. - In the
.cd-textboxselector, replace the declarationclear:bothwithoverflow:hidden. - Save the page.
The change applies to all message boxes in this subwiki. To change the alignment in all subwikis, make the same change to Template:Textbox/styles.css in the shared resources wiki.
Before:
.cd-textbox {
padding: 14px;
margin: 2em 0 1em 0;
display: table;
position:relative;
width: 100%;
clear:both;
}
After:
.cd-textbox {
padding: 14px;
margin: 2em 0 1em 0;
display: table;
position:relative;
width: 100%;
overflow:hidden;
}