Mlink-rodrigue (talk | contribs)
No edit summary
Mlink-rodrigue (talk | contribs)
m (username removed) (log details removed)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
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 <code>Template:Textbox</code>. <br> <br>For more information about inserting content droplets, refer to [[Extension/ContentDroplets|Content Droplets]].
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 <code>Template:Textbox</code>.  
== Insert a message box ==
== Insert a message box ==
To insert a message box in [[Extension/VisualEditor|VisualEditor]]:
{{VEinsertDroplets|name=Message|inspector=1}}
# Search for a content droplet '''Message'''.
 
# Select a '''Message''' droplet and select '''Insert'''. A dialog opens.
​The available message types are: Note, Important, Warning, Tip, Success, Message.
# Set the parameters in the dialog:
[[File:Extension ContentDroplets - Textbox types.png|alt=Screenshot with all available message banner types|center|thumb|650x650px|Textbox types]]
#* '''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 <code><nowiki>'''bold'''</nowiki></code> or <code><nowiki>''italic''</nowiki></code>.
# Select '''Insert'''. The message box appears on the page.
== Parameters ==
== Parameters ==
The following table lists the dialog fields and the corresponding template parameters:
 
{| class="wikitable" style="width: 100%;"
{| class="wikitable" style="width: 100%;"
|+Template parameters
! style="width:150px;" |Parameter
! style="width:150px;" |Parameter
!Template parameter
!Template parameter
Line 21: Line 18:
|Shows the icon of the box type. Allowed value in wikitext: <code>yes</code>. If the parameter is empty, the box has no icon.
|Shows the icon of the box type. Allowed value in wikitext: <code>yes</code>. If the parameter is empty, the box has no icon.
|-
|-
| style="width:150px;" |Box Type
| style="width:150px;" |Box type
|<code>boxtype</code>
|<code>boxtype</code>
|Determines the type of the box. Each type has its own border color, background color, and icon.
|Determines the type of the box. Each type has its own border color, background color, and icon.
Line 36: Line 33:
|Sets the content of the box. The parameter accepts wikitext.
|Sets the content of the box. The parameter accepts wikitext.
|}
|}
To insert a message box in wikitext, use the following syntax:
== Customize this template ==
<syntaxhighlight lang="wikitext">
{{SharedResourceInfo|template=Textbox|templatestyles=Textbox/styles.css}}
{{Textbox
|boxtype = note
|icon = yes
|header = Note
|text = Text of the message box.
}}
</syntaxhighlight>
== Adjust the alignment ==
This section is intended for administrators.
 
<code>Template:Textbox</code> is a standard system template. The template and its style sheet <code>Template:Textbox/styles.css</code> are maintained centrally in the [[Extension/BlueSpiceWikiFarm|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 <code>clear:both</code> in the <code>.cd-textbox</code> selector causes this behavior.


To display the box within the text flow in a single subwiki:
=== Adjust the alignment ===
# Copy <code>Template:Textbox</code> and <code>Template:Textbox/styles.css</code> from the shared resources wiki to the subwiki.
By default, the box is displayed in full-width. This means that it is displayed below any image that is used directly before the box and that is set to text-wrap.
# In the subwiki, open the page <code>Template:Textbox/styles.css</code> for editing.
# In the <code>.cd-textbox</code> selector, replace the declaration <code>clear:both</code> with <code>overflow:hidden</code>.
# 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 <code>Template:Textbox/styles.css</code> in the shared resources wiki.
To keep the box within the text-flow, you can make the following change in <code>Template:</code><code>Textbox/styles.css</code>:


Before:
Before:
Line 85: Line 64:
}
}
</syntaxhighlight>
</syntaxhighlight>
[[File:Extension ContentDroplets Textbox text-wrap.png|alt=Message of type "Note" to the side of an image after changing the style sheet|center|thumb|650x650px|Message that wraps around an image after adjusting the style sheet]]

Latest revision as of 18:12, 13 November 2026

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.

Insert a message box

  1. Select the Content droplets action in the editor toolbar.
  2. Filter for the Content droplet Message.
  3. Insert the content droplet. An inspector menu opens.
Content droplets inspector menu
Selecting a Content droplet


​The available message types are: Note, Important, Warning, Tip, Success, Message.

Screenshot with all available message banner types
Textbox types

Parameters

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): success, warning, important, note, tip, neutral

The colors are defined in Template:Textbox/styles.css and cannot be selected when entering the parameters. Additional colors must be added to the CSS. For more information, refer to Adjust the alignment.

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.

Customize this template

admin info


Shared resource template

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 affect all wikis, unless the template also exists in an individual wiki.

To change the template for a single wiki only, copy the template to that wiki and make the changes there. Changes to the copy affect only the individual wiki.


Adjust the alignment

By default, the box is displayed in full-width. This means that it is displayed below any image that is used directly before the box and that is set to text-wrap.

To keep the box within the text-flow, you can make the following change in Template:Textbox/styles.css:

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;
}
Message of type "Note" to the side of an image after changing the style sheet
Message that wraps around an image after adjusting the style sheet