Template:Mbox: Difference between revisions

From stencil.wiki
No edit summary
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|#f1f3f5}}}; border: {{{border|1px solid #F1F3F5}}}; {{#if:{{{color_bar|}}}|border-left: 10px solid {{{color_bar}}};|}} {{{style|}}}"
{{#if:{{{title|}}}|<tr><th>{{{title}}}</th></tr>|}}
{{#if:{{{title|}}}|<tr><th>{{{title}}}</th></tr>|}}
|-
|-

Revision as of 16:57, 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, or other templates like {{Ink chip|Plum}}—transcluded with <code>{{Ink chip|Plum}}</code>.}}
Sample styled title
A plain box with a title and some markup in the text, or other templates like Plum—transcluded with {{Ink chip|Plum}}.

TemplateData

A simple message box. This template is meant to implement specific message boxes, not to be invoked directly.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Titletitle

Header text to be used at the top of the box—this will be displayed in bold.

Stringsuggested
Texttext

The body text of the message box.

Stringrequired
Class (CSS)class

Custom class to add to the table.

Stringsuggested
Backgroundbackground

Background color for the box (neutral grey if not specified). Embedded in the "background" CSS property.

Stringoptional
Borderborder

Border style for the box. Embedded in the "border" CSS property.

Stringoptional
Color barcolor_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.

Stringoptional
Stylestyle

Additional CSS styles embedded at the end of the inline styles for the box

Stringoptional