Difference between revisions of "Template:Mbox"

From Kumu Wiki - TRU
Jump to navigation Jump to search
(switch to Lua version)
m (1 revision)
Line 1: Line 1:
{{#invoke:Message box|mbox}}<noinclude>
+
<includeonly><table class="plainlinks noprint messagebox {{{type|notice}}}" {{#if:{{{style|}}}|style="{{{style}}}"}}> 
 +
<tr style="vertical-align:middle;">{{#ifeq:{{{image|yes}}}|none
 +
|<!-- no image cell -->
 +
|<td style="padding:0.1em; text-align:center; vertical-align:middle; width:45px;">
 +
{{#if:{{{image|}}}|[[Image:{{{image}}}|{{{size|40x40px}}}]]|{{#switch:{{{type|}}}
 +
| warning  = [[Image:Nuvola apps important.svg|{{{size|40x40px}}}]]
 +
| serious  = [[Image:Stop hand nuvola.svg|{{{size|40x40px}}}]]
 +
| content  = [[Image:Book important2.svg|{{{size|45x45px}}}]]
 +
| style    = [[Image:Applications-office.svg|{{{size|40x40px}}}]]
 +
| merge    = [[Image:Merge-split-transwiki default.svg|{{{size|40x40px}}}]]
 +
| move    = [[Image:Merge-split-transwiki default.svg|{{{size|40x40px}}}]]
 +
| growth  = [[Image:Nuvola apps bookcase.svg|{{{size|40x40px}}}]]
 +
| idea    = [[Image:Dialog-information on.svg|{{{size|40x40px}}}]]
 +
| query    = [[Image:Emblem-question.svg|{{{size|40x40px}}}]]
 +
| free    = [[Image:GreenCopyleft.svg|{{{size|40x40px}}}]]
 +
| nonfree  = [[Image:Orange copyright.svg|{{{size|40x40px}}}]]
 +
| pd      = [[Image:PD-icon.svg|{{{size|40x40px}}}]]
 +
| blank    = <!-- empty image cell -->
 +
|#default  = [[Image:Book notice.svg|{{{size|40x40px}}}]]}}}}</td>}}
 +
<td style="{{{text style|color:black; text-align:left; vertical-align:middle; padding:0.5em; padding-left:0em;}}}">
 +
{{{1|{{{msg|{{{text|''Enter Text''}}}}}}}}}
 +
</td>
 +
{{#if:{{{imageright|}}}|<td style="padding:0.1em; padding-left:0em; text-align:center; vertical-align:middle;">{{{imageright}}}</td>}}
 +
</tr></table></includeonly>
 +
<noinclude>
 
{{documentation}}
 
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
+
[[Category:Infobox templates|{{PAGENAME}}]]
 
</noinclude>
 
</noinclude>

Revision as of 15:09, 24 October 2013


[edit] Template-info.svg Template documentation

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.

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.