Template:Ombox

From OpenStreetMap Wiki
Jump to navigation Jump to search
[Edit] [Purge] Template-info.svg Template documentation

This template produces a stylized, full-width message box suitable for use on pages outside of the Main namespace, such as Category:, Template: and User:, and their corresponding talk namespaces.

Usage

The template is shown below with its full complement of parameters for copy/pasting into other pages.

{{Ombox|type= |image= |imageright= |class= |style= |small= |lang= |dir= |textstyle= |text= }}

Types

The overall appearance of the message box, such as its coloring and the image shown at left, are controlled by the |type = parameter. All of its valid values are demonstrated below.

{{Ombox|type=notice}} (default)
{{Ombox|type=content}}
{{Ombox|type=style}}
{{Ombox|type=move}}
{{Ombox|type=protection}}
{{Ombox|type=delete}}
{{Ombox|type=speedy}}

Compact layout

The small parameter offers a much different style of message box that consumes far less space while floated to the right page margin and is more suited to information of less importance. It is activated when given the value |small = yes, producing the style shown at right.

Images

The default message box style is to show a single icon near the left border that indicates the message type as defined by the type parameter. This image may be overridden using the image parameter. When assigning a custom image, be sure to use only the actual filename without the File: namespace prefix, as the template adds that automatically. All images shown by this template are constrained to a size of 40 pixels (30 pixels when the small parameter is activated) on their longer axis, with their shorter axis adjusted to maintain its original aspect ratio.

Right-hand image

A second image may be specified to appear level with the default icon but on the right side through the use of the imageright parameter. The message text will not wrap around it, though, so this often comes at the cost of requiring extra vertical space for the message text.

Suppressing image use

If you wish to use this template to produce a message box without an icon near the left edge, that can be accomplished with the parameter assignment |image = none.

TemplateData

This is the TemplateData for this template used by VisualEditor.
TemplateData for Ombox

Produces a stylized, full-width message box suitable for placement on page outside of the Main namespace

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Message typetype

Selects the primary (left side) icon and color palette of the message box

Suggested values
notice content style move protection delete speedy
Default
notice
Example
content
Linesuggested
Messagetext

The text of the message the box is meant to highlight, formatted as wikitext

Example
Down! Bad dog!!
Stringrequired
Message styletextstyle

Custom styling for the message text, formatted as valid CSS3 declarations with terminating semicolons

Example
color: firebrick; font-weight: 500;
Lineoptional
Icon (primary)image

The filename of an image to be shown on the left side of the message box in place of the default image derived from the value of the 'type' parameter; do not include the 'File:' namespace prefix.

Fileoptional
Icon (right)imageright

The filename of an image to be shown on the right side of the message box; do not include the 'File:' namespace prefix.

Fileoptional
Compact layoutsmall

When set to 'yes', alters the box's layout to produce a more compact and less obtrusive appearance

Example
yes
Booleanoptional
Custom box stylingstyle

The style of the message box can be customized with the assignment of valid CSS3 declarations as the value of this parameter; do not enclose them in quotation marks, but do ensure they are all terminated with a semicolon.

Example
background-color: #ffe228; border: 2px dotted #000;
Lineoptional
Custom box classclass

Accepts a space-delimited list of additional CSS3 classes to assign to the message box

Example
toc2
Lineoptional
Language codelang

If the message text is in a language that does not match the page it appears on, the ISO 639-1 language code for the text should be used as the value for this parameter to ensure it is properly parsed

Default
en
Example
pt-PT
Lineoptional
Text directiondir

If the message box text is in a language that is written in a different direction than the rest of the page it appears on, declare its direction here to ensure it is displayed as intended

Suggested values
ltr rtl
Default
ltr
Example
rtl
Lineoptional
Compact imagesmallimage

This parameter is deprecated and no longer has any impact on the template's output

Filedeprecated
Compact image (right)smallimageright

This parameter is deprecated and no longer has any impact on the template's output

Filedeprecated
Compact message textsmalltext

This parameter is deprecated and no longer has any impact on the template's output

Stringdeprecated

See also