Template:Mbox: Difference between revisions
| Robertbaxter (talk | contribs) No edit summary | Robertbaxter (talk | contribs)  No edit summary | ||
| Line 17: | Line 17: | ||
| {{mbox|text=Sample message text in a plain box.}} | {{mbox|text=Sample message text in a plain box.}} | ||
| <pre>{{mbox|title=Sample '' | <pre>{{mbox|title=Sample ''styled'' title|text=A plain box with a title and '''some markup''' in the text and other templates like {{Ink chip|Plum}} or [[links]].}}</pre> | ||
| {{mbox|title=Sample ''styled'' title|text=A plain box with a title and '''some markup''' in the text and other templates like {{Ink chip|Plum}}  | {{mbox|title=Sample ''styled'' title|text=A plain box with a title and '''some markup''' in the text and other templates like {{Ink chip|Plum}} or [[links]].}} | ||
| === Styling === | === Styling === | ||
| Line 31: | Line 31: | ||
| 	"params": { | 	"params": { | ||
| 		"class": { | 		"class": { | ||
| 			"label": "Class  | 			"label": "Class", | ||
| 			"description": "Custom class to add to the table.", | 			"description": "Custom class to add to the table.", | ||
| 			"type": "string", | 			"type": "string", | ||
| Line 67: | Line 67: | ||
| 			"type": "string", | 			"type": "string", | ||
| 			"required": true | 			"required": true | ||
| 		}, | |||
| 		"max_width": { | |||
| 			"label": "Max width", | |||
| 			"description": "The max width for the message box (should be percentage based).", | |||
| 			"type": "string", | |||
| 			"default": "80%" | |||
| 		} | 		} | ||
| 	}, | 	}, | ||
| Line 73: | Line 79: | ||
| 		"title", | 		"title", | ||
| 		"text", | 		"text", | ||
| 		"color_bar", | |||
| 		"class", | 		"class", | ||
| 		"background", | 		"background", | ||
| 		"border", | 		"border", | ||
| 		" | 		"max_width", | ||
| 		"style" | 		"style" | ||
| 	], | 	], | ||
Revision as of 17:31, 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—they will auto-size to the width of their contents, and wrap text at full width. They can include markup and full wiki-text (including transcluding other templates).
{{mbox|text=Sample message text in a plain box.}}
| Sample message text in a plain box. | 
{{mbox|title=Sample ''styled'' title|text=A plain box with a title and '''some markup''' in the text and other templates like {{Ink chip|Plum}} or [[links]].}}
| Sample styled title | 
|---|
| A plain box with a title and some markup in the text and other templates like Plum or links. | 
Styling
The main differentiation provided is in a 10px color bar on the left side of the box, which can be set with color_bar. Both the background and border styles can be set, as well as a CSS class for the box or custom style. The max-width is provided at 80%, but can be set with max_width.
{{mbox|text=Sample message text in a plain box.|color_bar=#BB76CF}}
| Orchid box | 
|---|
| A box with an orchid side bar. | 
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 | 
| 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 | 
| Class | 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 | 
| Max width | max_width | The max width for the message box (should be percentage based). 
 | String | optional | 
| Style | style | Additional CSS styles embedded at the end of the inline styles for the box | String | optional |