Template:Mbox

From UBC Wiki
Jump to: navigation, search


Documentation icon Template documentation[view] [edit] [history] [purge]

Usage

This is the {{mbox}} or message box meta-template.

It is used to build message box templates, using CSS classes to reskin it for specific namespaces. It offers several different colours, uses default images if no image parameter is given and it has some other features.

Ading mbox in Visual Editor

If you want to add mbox in Visual Editor (default editor), follow the step below:

  1. Go to Insert>Template
  2. Under Add a template, type mbox. Then click on Add template.
  3. Fill in the parameters (For the explanation of paramesters, see below), then insert the template.

Usage

{{mbox
| type      = query (optional)
| image     = Emblem-question-yellow.svg (optional)
| style     = width:400px; color:red; font-weight:bold; font-style:italic; (optional)
| text      = The message body text.
}}


Message box types


Image message box types

In the Image namespace, several additional options are available. It is recommended you still use {{imbox}} for these boxes in the meantime, as imbox uses different markup in line with other Ambox implementations and the image margins used on mbox are different.

Other images

The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.

Special

Some other parameter combinations.


Technical details

This template uses CSS classes.

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 a start and end brace { } work fine as they are. 
But here is a pipe {{!}} and two end braces <nowiki>}}</nowiki>. 
And now a pipe and end braces <nowiki>|}}</nowiki>.
</div>
}}


Internally this meta-template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta-templates since wiki markup has several drawbacks. For instance it makes it harder to use parser functions and special characters in parameters.

mbox is used to build message box templates, using CSS classes to reskin it for specific namespaces. It offers several different colours, uses default images if no image parameter is given and it has some other features.

Template parameters

ParameterDescriptionTypeStatus
11

no description

Default
empty
Example
empty
Auto value
empty
Unknownoptional
Typetype

parameter for messagebox type. You can choose from warning, serious, content,style,merge,notice,growth,idea, query

Default
empty
Example
content
Auto value
empty
Unknownsuggested
Stylestyle

You can add CSS styling to customize the box

Default
empty
Example
width:400px; color:red; font-weight:bold; font-style:italic; (optional)
Auto value
empty
Unknownoptional
Imageimage

You can add your own image to the box

Default
empty
Example
Emblem-question-yellow.svg
Auto value
empty
Unknownoptional
Sizesize

no description

Default
empty
Example
empty
Auto value
empty
Unknownoptional
Text styletext style

no description

Default
empty
Example
empty
Auto value
empty
Unknownoptional
Msgmsg

no description

Default
empty
Example
empty
Auto value
empty
Unknownoptional
Texttext

Add The message body text here

Default
empty
Example
This is a mbox
Auto value
empty
Unknownsuggested
Imagerightimageright

no description

Default
empty
Example
empty
Auto value
empty
Unknownoptional