Support/Design/Boxes

De DigiWiki.

Usage

Simple usage example:

{{imbox | text = Some text.}}

Complex example:

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

Image message box types

The following examples use different type parameters but use no image parameters thus they use the default images for each type.

Other images

The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.

Special

Some other parameter combinations.

Parameters

List of all parameters:

{{imbox
| type  = speedy / delete / content / style / notice / 
          move / protection / license / featured
| image = none / [[Image:Some image.png|40px]]
| imageright = [[Image:Some image.png|40px]]
| style = CSS value
| textstyle = CSS value
| text  = The message body text.
| below = More text or another imbox.
}}

type

If no type parameter is given the template defaults to type notice. That means it gets a blue border.

image

No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
image = [[Image:Gnome-dev-camera.svg|40px]]
none = Means that no image is used.

imageright

No parameter = If no imageright parameter is given then no image is shown on the right side.
An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (But the message box can handle images of any size.) For example:
imageright = [[Image:Nuvola apps bookcase.png|40px]]
Anything = Any other object that you want to show on the right side.

style

An optional CSS value used by the entire message box table. Without quotation marks " ". For example:
style = margin-bottom: 0.5em;

textstyle

An optional CSS value used by the text cell. For example:
textstyle = text-align: center;

text

The message body text.

below

A full width area below the images and text area. Can take a text or any kind of object, for instance another imbox:
below = {{imbox | type = content | text = This license tag is deprecated. }}

Technical details

Namespace "Image:" was renamed to "File:" on 11 December 2008. This template was created long before that, and that is why it is named "imbox" as in "image message box".

If you need to use special characters in the text parameter then you need to escape them like this:

{{imbox
| text  = <div>
Equal sign = and a start and end brace { } work 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>
}}

This template uses the imbox CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.

See also

There are several meta-templates in the mbox family:

  • {{ambox}} – For article message boxes.
  • {{cmbox}} – For category message boxes.
  • {{imbox}} – For file (image) page message boxes.
  • {{mbox}} – Has namespace detection, for message boxes that are used on several types of pages and thus need to change style depending on what page they are used on.
  • {{ombox}} – For other pages message boxes.
  • {{tmbox}} – For talk page message boxes.

Closely related meta-templates:

  • {{asbox}} – For article stub message boxes.
  • {{dmbox}} – For disambiguation and set index message boxes.
  • {{fmbox}} – For header and footer message boxes.





Hardcoded box.
Some text.

Here are the ambox class names and what they define.

ambox – The box size, border, background and default colour etc.
Image mbox-image and mbox-imageright
The size and padding etc of the image cells.
Imageright
mbox-text – The size and padding etc of the text cell.
ambox-speedy – The red+pink "speedy deletion" style.
ambox-delete – The red "deletion" style.
ambox-content – The orange "content issues" style.
ambox-style – The yellow "style issues" style.
ambox-notice – The blue "article notices" style.
ambox-move – The purple "move/merge/split/transwiki proposals" style.
ambox-protection – The gray "protection" style.

More usage

{| class="ambox ambox-notice"
| class="mbox-image" | [[Image:Gnome globe current event.png|42px]]
| class="mbox-text" | <div>
'''This article or section documents a current [[spaceflight]].'''
<br>Content may change as the mission progresses.
</div>
| class="mbox-imageright" | [[Image:Shuttle.png|20px]]
|}

This article or section documents a current spaceflight.
Content may change as the mission progresses.

These are how the various {{ambox}} templates will currently be displayed from your account. If you've never edited your monobook.css page before, these boxes reflect settings in MediaWiki:Common.css. (Search for "ambox" on that page.)

The options

Muted

From Equazcion and Quiddity:

Add this code to your own monobook.css:

/* "Muted" v0.1 color bars for the article message box templates */
table.ambox-delete {
  border-left: 10px solid #B22222 ;
}
table.ambox-content {
  border-left: 10px solid #FFCC66 ;
}
table.ambox-style {
  border-left: 10px solid #F3EF84 ;
}
table.ambox-move {
  border-left: 10px solid #BB99FF ;
}
table.ambox-notice {
  border-left: 10px solid #BBE3F4 ;
}

Light

From BenB4:

Add this code to your own monobook.css:

/* "Light" v0.1 color bars for the article message box templates */
table.ambox-delete {
  border-left: 10px solid #ff8888 ;
}
table.ambox-content {
  border-left: 10px solid #FFCC66 ;
}
table.ambox-style {
  border-left: 10px solid #f7f777 ;
}
table.ambox-move {
  border-left: 10px solid #ddbbFF ;
}
table.ambox-notice {
  border-left: 10px solid #aaeeFF ;
}

Pastel

From the mainpage colors:

Add this code to your own monobook.css:

/* "Pastel" v0.1 color bars for the article message box templates */
table.ambox-delete {
  border-left: 10px solid #F2CECE ;
}
table.ambox-content {
  border-left: 10px solid #F2E0CE ;
}
table.ambox-style {
  border-left: 10px solid #F2F2CE ;
}
table.ambox-move {
  border-left: 10px solid #DDCEF2 ;
}
table.ambox-notice {
  border-left: 10px solid #CEDFF2 ;
}

All-Color

From Anomie:

Add this code to your own monobook.css:

/* "All-Color" v0.1 for the article message box templates */
table.ambox {
  background: #f8fcff; 
  border: 1px solid #aaa; 
}
table.ambox-delete {
  background: #efd2d2;
}
table.ambox-content {
  background: #fce6cc;
}
table.ambox-style {
  background: #fcf3d5;
}
table.ambox-move {
  background: #ead6f4;
}
table.ambox-notice {
  background: #d2e8ff;
}

Eliminate icons completely

Add this code to your own monobook.css:

/* "Eliminate icons" v0.1 for the article message box templates */
.mbox-image {
  display: none;
}
.mbox-imageright {
  display: none;
}

Eliminate specific message box types

From CBDunkerson:

Add this code to your own monobook.css:

/* Remove messages boxes relating to article style */
table.ambox-style {
  display: none;
}
/* Remove messages boxes relating to article content */
table.ambox-content {
  display: none;
}
/* Remove ALL message boxes */
table.ambox {
  display: none;
}


Message box types



More examples

Some other parameter combinations.

Parameters

List of all parameters:

{{mbox
| type  = critical / serious / warning / notice / / move / protection
| image = none / [[File:...|40px|...]]
| imagewidth = width of image section / default is 52px
| imageright = [[File:...|40px|...]]
| imagerightwidth = width of right image section / default is 52px
| style = CSS values
| textstyle = CSS values
| text  = The message body text.
| small = {{{small|}}} / left
| smallimage = none / [[File:...|20px|...]]
| smallimageright = none / [[File:...|20px|...]]
| smalltext  = A shorter message body text.
}}
Outils personnels
  • Cette page a été consultée 527 fois.
donate
Google Ads