Template:Mbox/doc

From UBC Wiki
Jump to: navigation, search

Usage[wikitext]

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[wikitext]

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[wikitext]

{{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[wikitext]


Image message box types[wikitext]

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[wikitext]

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[wikitext]

Some other parameter combinations.


Technical details[wikitext]

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.