Jump to content

Template:Ombox/doc

From Wikipedia
Message box
meta-templates
templatecontext
{{Ambox}}article
{{Cmbox}}category
{{Imbox}}image
{{Tmbox}}talk
{{Fmbox}}footer / header
{{Ombox}}other pages
{{Mbox}}auto-detect
{{Asbox}}article stub
{{Dmbox}}disambiguation

Dis na the {{Ombox}} ([O]ther pages [m]essage [box]) meta-template.

Dem dey use am to build message box templates for pages like User, Wikipedia, MediaWiki, Template, Help, Portal, plus any new namespaces wey fit come later. In oda words, na for page types wey {{Ambox}}, {{Tmbox}}, {{Imbox}}, or {{Cmbox}} no cover. So, you no suppose use am for boxes wey belong to articles, talk pages, image pages, or category pages.

Dis template dey work almost the same way as {{Ambox}}, and e dey use the same parameters.

Introduction

[edit source]

Like we talk before, you suppose use dis template for message boxes wey no be article pages, talk pages, image pages, or category pages. Some message boxes for oda pages fit still dey use one of those four templates by mistake. If you see any message box wey dey for "other pages", you fit change am make e use dis meta-template. If you jam any hard case wey no clear, put am for dis template ein talk page and somebody go help you.

When dem use dis template build message boxes for oda pages, those boxes suppose still get explanatory text like before. (Fit be the same text or better improved text.) If you get image wey fit the box pass the default one, use am instead of the default image wey dem show here.

Simple example:

{{ombox
| text      = Some text.
}}

Complex example:

{{ombox
| type      = style
| image     = [[File:Emblem-question-yellow.svg|40px]]
| style     = width: 400px;
| textstyle = color: red; font-weight: bold; font-style: italic;
| text      = The message body text.
}}

Other pages message box types

[edit source]

The examples below dey use different type parameters, but dem no use any image parameter. Because of dat, dem go use the default image wey belong to each type.

Examples

[edit source]

Some examples wey dey use the "notice" style:

Parameters

[edit source]

List of all parameters:

{{ombox
| name = template ein name
| type = speedy / delete / content / style / notice / move / protection
| image = none / [[File:Some image.svg|40px]]
| imageright = [[File:Some image.svg|40px]]
| style = CSS values
| textstyle = CSS values
| plainlinks = no
| text = The body text of the message.
| small = {{{small|}}} / yes
| smallimage = none / [[File:Some image.svg|30px]]
| smallimageright = none / [[File:Some image.svg|30px]]
| smalltext = Shorter body text for the message.
}}

name

(Optional) The name of the template. Dis one dey add one CSS class wey get the name box-name to the HTML element, so bots or scripts fit use am.

type

If you no give any type parameter, the template go use notice by default. Dat one mean say e go get gray border.

image

No parameter = If you no give image, the template go use one default image. Which default image e go use depend on the type parameter.
An image = E suppose be image wey use normal wiki notation. 40px–50px width dey usually okay, depending on the image shape. (But the message box fit handle any image size.) Example:
image = [[File:Crystal package settings.png|40px]]
none = Mean say no image go show.

imageright

No parameter = If you no give imageright, no image go show for the right side.
An image = E suppose use normal wiki notation. Around 40px–50px width dey usually okay. Example:
imageright = [[File:Nuvola apps bookcase.png|40px]]
Anything = You fit put any oda object wey you want make e show for the right side.

style

Optional CSS values wey go apply to the whole message box table. No put quotation marks " ", but remember the ending semicolon ;. Example:
style = margin-bottom: 0.5em;

textstyle

Optional CSS values wey go apply only to the text cell. Example:
textstyle = text-align: center;

plainlinks

Normally for Wikipedia, external links get small arrow icon beside dem, like dis:

Example.com

But inside message boxes, the arrow icon no dey show by default, like dis:

Example.com

If you want make the arrow icon show like normal, use |plainlinks=no.

text

The main body text of the message.

The small parameters

[edit source]

small

yes = E go make the message box small and float for the right side. E go also make the default images smaller.

Take note say anything wey you put inside smallimage, smallimageright, and smalltext go work only if "small=yes".

If you want make your own template support the small parameter too, use dis code:

small = {{{small|}}}

smallimage

No parameter = If you no give smallimage, the template go first use the image parameter. If image too no dey, then e go use one small default image.
An image = E suppose use normal wiki notation. Around 30px width dey usually okay. Example:
smallimage = [[File:Replacement filing cabinet.svg|30px]]
none = Mean say no image go show. If "small=yes", dis one go override anything wey you put for image.

smallimageright

No parameter = If you no give smallimageright, the template go use imageright. If imageright too no dey, then nothing go show for the right side.
An image = E suppose use normal wiki notation. Around 30px width dey usually okay. Example:
smallimageright = [[File:Nuvola apps bookcase.png|30px]]
Anything = Any oda object wey you want make e show for the right side.
none = Mean say no image go show for the right side. If "small=yes", dis one go override imageright.

smalltext

Short version of the message body text. If you no give smalltext, the template go use the normal text parameter instead.

Technical details

[edit source]

If you need use special characters inside the text parameter, then you for escape dem like dis:

{{ombox
| text = <div>
Equal sign = plus opening and closing braces { } dey work fine as dem be.
But dis one get one pipe {{!}} plus two closing braces <nowiki>}}</nowiki>.
And now one pipe plus closing braces <nowiki>|}}</nowiki>.
</div>
}}

Dis template dey use the ombox CSS classes wey dey inside MediaWiki:Common.css for most of how e look. Because of dat, you fit style am for different skins.

The default images wey dis meta-template dey use be PNG files instead of SVG files. The main reason be say some old web browsers no dey handle the transparent background wey MediaWiki render for SVG images well. The PNG images wey dey here get hand-optimized transparent backgrounds so dem go look better for all browsers.

Take note say SVG icons no really bad except for some old browsers. Because of dat, dis hand optimization only worth the work for icons wey people dey use plenty.

If you want know more technical information, check the talk page.

Since dis template dey work almost the same way as {{ambox}}, {{tmbox}}, {{imbox}}, and {{cmbox}}, their talk pages and related pages fit also get more technical information wey fit help you.

See also

[edit source]

Template:Mbox templates see also