Jump to content

Module:Message box/doc

From Simple English Wikipedia, the free encyclopedia
Revision as of 11:01, 8 October 2013 by Mr. Stradivarius (talk | changes) (expand some more)

This is the documentation page for Module:Message box


This module implements the message box templates {{mbox}}, {{ambox}}, {{cmbox}}, {{fmbox}}, {{imbox}}, {{ombox}}, and {{tmbox}}. It uses the same basic code for each of these templates; the differences between each of them are configured using the data at Module:Message box/configuration.

Usage

Common parameters
{{#invoke:Message box|box type
| type       = 
| text       = 
| image      = 
| imageright = 
| nocat      = 
| page       = 
| demospace  = 
}}

There are seven available box types:

  • mbox - for message boxes to be used in multiple namespaces
  • ambox - for article message boxes
  • cmbox - for category message boxes
  • fmbox - for interface message boxes
  • imbox - for file namespace message boxes
  • tmbox - for talk page message boxes
  • ombox - for message boxes in other namespaces

Common parameters

These parameters work with all box types.

type

The type parameter defines the colour of the left bar, and the image that is used by default. The type is chosen not on aesthetics but is based on the type of issue that the template describes. For example, there is a speedy type for speedy deletion messages, and an style type for messages dealing with style issues. They look like this:

Different templates support different types; you can find which templates support which types in the table below.

Type Supported by
speedy ambox, cmbox, imbox, ombox, tmbox
delete ambox, cmbox, imbox, ombox, tmbox
content ambox, cmbox, imbox, ombox, tmbox
style ambox, cmbox, imbox, ombox, tmbox
move ambox, cmbox, imbox, ombox, tmbox
protection ambox, cmbox, imbox, ombox, tmbox
notice ambox, cmbox, imbox, ombox, tmbox
warning fmbox
editnotice fmbox
system fmbox
license imbox
featured imbox

If no type parameter is given, the module defaults to the type specified in cfg.default.

text

The message body text.

image

You can choose a specific image to use for the template by using the image parameter. Images are specified using the standard syntax for inserting files in Wikipedia (see Wikipedia:Manual of Style/Images#How to place an image.) Widths of 40-50px are typical. For example:

  • {{POV}} specifies |image=[[File:Unbalanced scales.svg|40px|link=|alt=]] and looks like this:
  • {{underlinked}} specifies |image=[[File:Ambox wikify.svg|50x40px|link=|alt=]] and looks like this:

Please note:

  • If no image is specified then the default image corresponding to the type is used. (See #type above.)
  • If |image=none is specified, then no image is used and the text uses the whole message box area.
  • If an icon is purely decorative and also in the public domain, accessibility can be improved by suppressing the link to the file page by adding "|link=|alt=" as seen above.

Other parameters

The following are other parameters that work with all box types.

style and textstyle

Optional CSS values may be defined, without quotation marks " " but with the ending semicolons ;.

  • style specifies the style used by the entire message box table.
  • textstyle relates to the text cell.

Parameters limited to specific box types

  • subst - depends on cfg.substCheck
  • id - depends on cfg.useId
  • small - depends on cfg.allowSmall
  • plainlinks - depends on cfg.usePlainlinksParam
  • name - depends on cfg.useCollapsibleTextFields
  • sect - depends on cfg.useCollapsibleTextFields
  • issue - depends on cfg.useCollapsibleTextFields
  • talk - depends on cfg.useCollapsibleTextFields
  • fix - depends on cfg.useCollapsibleTextFields
  • date - depends on cfg.useCollapsibleTextFields
  • info - depends on cfg.useCollapsibleTextFields
  • smalltext - depends on cfg.allowSmall
  • below - depends on cfg.below
  • smallimage - depends on cfg.allowSmall
  • smallimageright - depends on cfg.allowSmall
  • cat, cat1, cat2, cat3, ... - depends on cfg.useMainspaceCategories
  • category, category1, category2, category3, ... - depends on cfg.useMainspaceCategories
  • all, all1, all2, all3, ... - depends on cfg.useMainspaceCategories