Template:Mbox/doc: Difference between revisions
More actions
Proposal for order: from minor issues via larger issues to serious and urgent notices |
"synonym type" a bit more explained |
||
| Line 144: | Line 144: | ||
{{mbox | {{mbox | ||
|text=<code><nowiki>type=</nowiki><span style="font-size:110%">'''style'''</span></code> → for cleanup (only | |text=<code><nowiki>type=</nowiki><span style="font-size:110%">'''style'''</span></code> → for cleanup ''(synonym to'' <code>query</code>, ''only different icon)'' | ||
|type=style | |type=style | ||
}} | }} | ||
| Line 152: | Line 152: | ||
|type=issue | |type=issue | ||
}} | }} | ||
{{mbox | {{mbox | ||
|text=<code><nowiki>type=</nowiki><span style="font-size:110%">'''content'''</span></code> → for content issues (synonym | |text=<code><nowiki>type=</nowiki><span style="font-size:110%">'''content'''</span></code> → for content issues ''(synonym to'' <code>issue</code>'')'' | ||
|type=content | |type=content | ||
}} | }} | ||
| Line 162: | Line 163: | ||
}} | }} | ||
{{mbox | {{mbox | ||
|text=<code><nowiki>type=</nowiki><span style="font-size:110%">'''delete'''</span></code> → for deletion notices (synonym | |text=<code><nowiki>type=</nowiki><span style="font-size:110%">'''delete'''</span></code> → for deletion notices ''(synonym to'' <code>serious</code>'')'' | ||
|type=delete | |type=delete | ||
}} | }} | ||
{{mbox | {{mbox | ||
|text=<code><nowiki>type=</nowiki><span style="font-size:110%">'''stop'''</span></code> → for stop and other caution notices | |text=<code><nowiki>type=</nowiki><span style="font-size:110%">'''stop'''</span></code> → for stop and other caution notices, such as frequent issues ''(synonym to'' <code>serious</code>, ''only different icon)'' | ||
|type=stop | |type=stop | ||
}} | }} | ||
| Line 177: | Line 178: | ||
{{mbox | {{mbox | ||
|text=<code><nowiki>type=</nowiki><span style="font-size:110%">'''warning'''</span></code> → for urgent notices (synonym | |text=<code><nowiki>type=</nowiki><span style="font-size:110%">'''warning'''</span></code> → for urgent notices ''(synonym to'' <code>speedy</code>'')'' | ||
|type=warning | |type=warning | ||
}} | }} | ||
| Line 187: | Line 188: | ||
{{mbox | {{mbox | ||
|text=<code><nowiki>type=</nowiki><span style="font-size:110%">'''protection'''</span></code> → for protection notices | |text=<code><nowiki>type=</nowiki><span style="font-size:110%">'''protection'''</span></code> → for protection notices ''(synonym to'' <code>message</code>, ''only different icon)'' | ||
|type=protection | |type=protection | ||
}} | }} | ||
Revision as of 17:02, 14 February 2024
This is used to create message boxes.
Usage
{{Mbox
|text =
|type =
|image =
}}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
text | text | The text to be displayed. | empty | required |
type | type | Changes the color depending on the message needed. Each has its own preset image, see #Examples | notice | optional |
image | left image | Override the image (“none” for no image). Use format: [[File:Commons-emblem-urgent.svg|class=noviewer|48px]]. The default depends on the type. | empty | optional |
imageright | right image | Show an image on the right side, similar to the left one (but empty by default). | empty | optional |
textstyle | text style | Override/augment default style of text cell (e.g. alignment — text-align:left; / text-align:right; / text-align:center;). | empty | optional |
style | box style | Override/augment default style of the whole message box. | empty | optional |
class | box class | Augment default CSS classes of the whole message box. Particularly useful if your template uses TemplateStyles. | empty | optional |
lang | language | Set the language of the text – it's important for right-to-left languages: their image is on the right and imageright is on the left. It helps assistive software (e.g. screen readers) even in left-to-right languages. | empty | optional |
width | box width | Set the width of the box (avoid using it, 80% for example is too large as it leaves only 10% of the page content width for the left/right margins where there may be floating elements generally large of about 250px: if this occurs the Mbox will be displayed at a much lower position on the page, as if there was a "clear:both", so Mbox may not be immediately visible without scrolling down the page with a huge blank space in the middle and all the rest of the page after the Mbox will be also invisible without scrolling). Instead, use the "margin" parameter to set horizontal margins. To avoid the centering, and/or the thick left border, modify e.g. “style=margin-left:0;border-left:2px solid #F4C430” | auto | optional |
margin | horizontal margin | Set the horizontal margin of the box (by default it is "auto" if a legacy width is specified, otherwise it is "10%"). | 10% | optional |
|
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard. Existing template documentation Newly created template documentation and imports Wikipedia's help about TemplateData • Commons-specific information This is used to create message boxes.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
See also
Localization
This template is not intended to be localized.
⧼Note⧽
The icon displayed in the message box is clickable and drives to Commons (to see its attributions), but only when the message box is displayed in a "Template:" page (including their talk pages). When the template is displayed in a page belonging to all other namespaces, no link is generated, only the icon is visible directly.
Examples
Different appearance depending on parameter type:
Examples with more parameters: