This page is semi-protected against editing.

Template:Mbox

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Documentation icon Documentationviewedithistorypurge

This documentation is transcluded from Template:Mbox/doc.

This is used to create message boxes.

Usage

{{Mbox
 |text =
 |type =
 |image =
 |imageright =
}}

Template parameters

ParameterDescriptionDefaultStatus
textThe text to be displayed.emptyrequired
typeChanges the color depending on the message needed. Each has its own preset image, see #Examplesnoticeoptional
imageOverride the image (none for no image). Use format: [[File:Commons-emblem-urgent.svg|class=noviewer|45px]]depends on styleoptional
imagerightShow an image on the right side.emptyoptional
textstyleOverride default style of text (e.g. alignment - text-align:left; / text-align:right; / text-align:center;).emptyoptional
styleOverride in custom style overrides for the template using CSS.emptyoptional
langSet the language of the text – it's important for right-to-left languages: their image is on the right and imageright is on the left.emptyoptional
widthSet the width of the box100%optional
Template data
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either useTemplateData=1 or useTemplateData=only on the /doc subpage and transcluding it with {{Documentation}} into the template. <nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw <templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

This is used to create message boxes.

Template parameters

ParameterDescriptionTypeStatus
image

Override the image (none for no image).

Default
depends on style
Example
empty
Auto value
empty
Pageoptional
imageright

Show an image on the right side.

Default
empty
Example
empty
Auto value
empty
Pageoptional
lang

Set the language of the text – it's important for right-to-left languages: their image is on the right and imageright is on the left.

Default
empty
Example
empty
Auto value
empty
Stringoptional
style

Override in custom style overrides for the template using CSS.

Default
empty
Example
empty
Auto value
empty
Stringoptional
text

The text to be displayed.

Default
empty
Example
empty
Auto value
empty
Contentrequired
textstyle

Override default style of text (e.g. alignment - text-align:left; / text-align:right; / text-align:center;).

Default
empty
Example
empty
Auto value
empty
Stringoptional
type

Changes the color depending on the message needed. Each has its own preset image, see [[#Examples]]

Default
notice
Example
empty
Auto value
empty
Stringoptional
width

Set the width of the box

Default
100%
Example
empty
Auto value
empty
Stringoptional

Additional information

The template is intended to be used in the following namespaces: all namespaces

The template is intended to be used by the following user groups: all users

Localization

This template is not intended to be localized.

Examples