Template:Mbox

Template page

Test Template Info-Icon.svg Template Documentation [ view ] [ edit ]

Ambox warning orange.svg This template is used by many other templates and pages.
To avoid major disruption, changes should be discussed on the talk page before implementing them.

Mbox stands for Message box. This is a meta template used to build message boxes for other templates, such as {{Notice}}. It offers several different colors and some other features. All templates that create a message box should use this template.

Usage

The box below shows the parameters that are accepted by {{Mbox}}. The purpose of each is described below.

{{mbox
| size       =
| color      =
| style      =
| text       =
| image      = 
| imageright =
}}

size

The size parameter modifies the size of the message box.

The default size will produce:

Information grey.svg This is the default sized message box and spans 80% of the page in the center.

Using size=mbox-small will produce:

Information grey.svg This message box has a smaller font and image size and spans 40% of the page from the left.

Using size=mbox-large will produce:

Information grey.svg This message box has a larger font and image size and spans the entire page.

color

The color parameter applies color classes from Mediawiki:Citizen.css. The available colors are shown below. If no color parameter is specified the template defaults to gray.

Information grey.svg color = pink - Used by {{Tip}}
Information grey.svg color = purple - Used by {{Obsidian}}
Information grey.svg color = violet - Used by {{In work}}
Information grey.svg color = blue – Used by {{Notice}}, {{Container category}}, {{Hidden category}}
Information grey.svg color = aqua
Information grey.svg color = teal
Information grey.svg color = green
Information grey.svg color = yellow – Used by {{Stub}}
Information grey.svg color = orange – Used by {{Important}}, {{Caution}}, {{High-use}}
Information grey.svg color = red
Information grey.svg color = gray/grey - – Used by {{Disambiguation}}

style

The style parameter is used to apply CSS styling to the message box. Style can be used to modify the width, alter the font, choose a custom set of colors, and much more.

Values are inserted without quotation marks " " but with the ending semicolons ;.

For example, using style=font-family:cursive; will produce:

Information grey.svg This is a message box with cursive font.

text

The text parameter fills in the text of the message box.

image

The image parameter changes the image that appears on the left. If no image parameter is specified the default image is Information grey.svg.

The default sized mbox formats the image to 40px. mbox-small formats it to 25px and mbox-large formats it to 55px.

Using image=MediaWiki-2020-large-icon.svg will produce:

MediaWiki-2020-large-icon.svg This message box has a different image. Thanks MediaWiki!

imageright

The imageright parameter adds an image to the right side of the message box. This works the same as the image parameter, except that the default is no image.

Using imageright=Information grey.svg will produce:

Information grey.svg This message box has images on both sides. Information grey.svg

Categorization

This template does not categorize the pages it is used on. Templates that use this template should be categorized with Category:Mbox templates.

Technical notes

  • The CSS for this template is defined in Template:Mbox/styles.css.
  • If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox
| text  = <div>
Equal sign = and single curly brackets { } work fine.

A pipe can be inserted using &#124; or <nowiki>|</nowiki>

Two cruly brackets can inserted using <nowiki>}}</nowiki>
</div>
}}
Information grey.svg

Equal sign = and single curly brackets { } work fine.

A pipe can be inserted using | or |

Two cruly brackets can inserted using }}

  • The <div> tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.

See also

Templates that use this template


Cookies help us deliver our services. By using our services, you agree to our use of cookies.