Template:Mbox: Difference between revisions
Robertbaxter (talk | contribs) No edit summary |
Robertbaxter (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
-->{| class="ambox {{{class|}}}" style="background: {{{background|#f8f9fa}}}; border: {{{border|1px solid #F1F3F5}}}; {{#if:{{{color_bar|}}}|border-left: 10px solid {{{color_bar}}};|}} {{{style|}}}" | -->{| class="ambox {{{class|}}}" style="background: {{{background|#f8f9fa}}}; border: {{{border|1px solid #F1F3F5}}}; {{#if:{{{color_bar|}}}|border-left: 10px solid {{{color_bar}}};|}} {{{style|}}}" | ||
{{#if:{{{title|}}}|<tr><th>{{{title}}}</th></tr>|}} | |||
|- | |- | ||
| {{{text}}} | | {{{text}}} | ||
Line 7: | Line 7: | ||
--></includeonly><templatestyles src="mbox/styles.css" /><!-- | --></includeonly><templatestyles src="mbox/styles.css" /><!-- | ||
--><noinclude> | --><noinclude> | ||
Lightweight message box (maybe ''notice'' box) to implement top-off page warnings needed on some pages. It allows some color flags/styling to distinguish boxes from each other, but primarily only offers a title and body text. | |||
== Usage == | |||
This box should be used within message-specific templates (e.g. [[Template:Class template]]) which parse their own inputs into the display fields of the message box. | |||
Plain boxes can be called with <code><nowiki>{{mbox}}</nowiki></code> while providing <code>text</code> and an optional <code>title</code>: | |||
<pre>{{mbox|text=Sample message text—displayed small and wrapping.}}</pre> | |||
{{mbox|text=Sample message text—displayed small and wrapping.}} | |||
== TemplateData == | |||
<templatedata> | <templatedata> | ||
{ | { |
Revision as of 15:44, 14 December 2024
Lightweight message box (maybe notice box) to implement top-off page warnings needed on some pages. It allows some color flags/styling to distinguish boxes from each other, but primarily only offers a title and body text.
Usage
This box should be used within message-specific templates (e.g. Template:Class template) which parse their own inputs into the display fields of the message box.
Plain boxes can be called with {{mbox}}
while providing text
and an optional title
:
{{mbox|text=Sample message text—displayed small and wrapping.}}
Sample message text—displayed small and wrapping. |
TemplateData
A simple message box. This template is meant to implement specific message boxes, not to be invoked directly.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Title | title | Header text to be used at the top of the box—this will be displayed in bold. | String | suggested |
Text | text | The body text of the message box. | String | required |
Class (CSS) | class | Custom class to add to the table. | String | suggested |
Background | background | Background color for the box (neutral grey if not specified). Embedded in the "background" CSS property. | String | optional |
Border | border | Border style for the box. Embedded in the "border" CSS property. | String | optional |
Color bar | color_bar | The color used for the left side bar of the box—no bar is displayed if left blank. Embedded in the "border-left" CSS property. | String | optional |
Style | style | Additional CSS styles embedded at the end of the inline styles for the box | String | optional |