{{#switch:
| serious =
| content = 40px | maintenance = 40px | notice = 40px | blank = | #default = 40px}} |
}}
{{{text}}} | {{{imageright}}} |
Notwithstanding any statement on this page, Template:Ambox is from Wikipedia and as such is licensed under the GNU Free Documentation License.
This is the ambox or article message box meta template.
It is used to create article message box templates such as Template:Tl etc. It offers several different colours, uses default images if no image parameter is given and it has some other features.
Contents |
Simple usage example:
{{ambox | text = Some text.}}
{{#switch:
| serious =
| content = 40px | maintenance = 40px | notice = 40px | blank = | #default = 40px}} |
}}
Some text. | {{{imageright}}} |
Complex example:
{{ambox
| type = maintenance
| image = [[File:Icon apps query.svg|38px]]
| text = The message body text.
}}
{{#switch:38px
| serious =
| content = 40px | maintenance = 40px | notice = 40px | blank = | #default = 38px}} |
}}
The message body text. | {{{imageright}}} |
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
{{#switch:serious
| serious =
| content = 40px | maintenance = 40px | notice = 40px | blank = | #default = 40px}} |
}}
type=serious – Serious issues, such as Template:Tl and Template:Tl | {{{imageright}}} |
{{#switch:content
| serious =
| content = 40px | maintenance = 40px | notice = 40px | blank = | #default = 40px}} |
}}
type=content – Content issues, such as Template:Tl and Template:Tl | {{{imageright}}} |
{{#switch:maintenance
| serious =
| content = 40px | maintenance = 40px | notice = 40px | blank = | #default = 40px}} |
}}
type=maintenance – Style issues, such as Template:Tl | {{{imageright}}} |
{{#switch:notice
| serious =
| content = 40px | maintenance = 40px | notice = 40px | blank = | #default = 40px}} |
}}
type=notice – Article notices, such as Template:Tl | {{{imageright}}} |
List of all parameters:
{{ambox
| type = serious / content / maintenance / notice
| image = none / blank / [[File:Some image.svg|40px]]
| imageright = [[File:Some image.svg|40px]]
| text = The message body text.
| id = html id for table
}}
type
image
[[File:Unbalanced scales.svg|40px]]
imageright
[[File:Nuvola apps bookcase.png|40px]]
text
id
If you need to use special characters in the text parameter then you need to escape them like this:
{{ambox
| text = <div>
Equal sign = and a start and end brace { } works 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>
}}
{{#switch:
| serious =
| content = 40px | maintenance = 40px | notice = 40px | blank = | #default = 40px}} |
}}
Equal sign = and a start and end brace { } works fine as they are. But here is a pipe | and two end braces }}. And now a pipe and end braces |}}. |
{{{imageright}}} |
This template uses CSS classes for most of its looks, thus it is fully "skinnable".
The CSS classes can also be used directly in a wikitable. Like this:
{| class="ambox ambox-content"
|-
| class="ambox-image" | [[File:Emblem-important.svg|40px]]
| Some text.
|}
| 40px | Some text. |
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.
For more technical details see the talk page and the "See also" links below.