قالب ويكيبيديا From Wikipedia, the free encyclopedia
![]() |
This is the {{ambox}} or article message box meta-template.
It is used to build article message box templates such as {{wikify}}. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the ambox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Simple usage example:
{{ambox | text = Some text.}}
![]() | Some text. |
Complex example:
{{ambox | type = style | small = left | image = [[ملف:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[ملف:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
![]() | Text for the top of article sections. |
But you are not really supposed to use red bold italic text.
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
![]() | type=speedy – Speedy deletion issues, such as {{db-g1}} and {{db-g3}}. |
![]() | type=delete – Deletion issues, such as {{afd}} and {{prod}}. |
![]() | type=content – Content issues, such as {{POV}} and {{globalize}}. |
![]() |
![]() |
![]() |
![]() |
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.
![]() | type = content image = [[ملف:Unbalanced scales.svg|40px|link=|alt=]] This image is often used for {{POV}} and similar issues. |
![]() | type = style image = [[ملف:Wikitext.svg|50px|link=|alt=]] This image is often used for {{wikify}} etc. |
![]() |
Some other parameter combinations.
![]() | No type and no image given (default) |
No type and image=none – No image is used and the text uses the whole message box area. |
image = [[ملف:Gnome globe current event.svg|42px|alt=Clock over a larger globe]] imageright = [[ملف:Nuvola apps bookcase.svg|40px|alt=Three stacked books]] |
This article or section documents a current spaceflight.
Content may change as the mission progresses. | ![]() |
List of all parameters:
{{ambox | type = speedy / delete / content / style / notice / move / protection | image = none / [[ملف:...|40px|...]] | imageright = [[ملف:...|40px|...]] | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[ملف:...|20px|...]] | smallimageright = none / [[ملف:...|20px|...]] | smalltext = A shorter message body text. }}
type
image
|link=
|alt=
". For example:
image = [[ملف:Unbalanced scales.svg|40px|link=|alt=]]
|link=
|alt=
", and which therefore is announced to visually impaired readers, should use an "|alt=alt text
" parameter that describes the icon. With no |link=
parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[ملف:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
|link=Page
" the alt text should describe the icon's function. For example:
image = [[ملف:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
imageright
imageright = [[ملف:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
style
" "
but with the ending semicolons ;
. For example:
style = margin-bottom: 0.5em;
textstyle
textstyle = text-align: center;
text
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
small = {{{small|}}}
![]() | small = left |
![]() | type = style small = left |
smallimage
smallimage = [[ملف:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
![]() | small = left image = [[ملف:Replacement filing cabinet.svg|50px|link=|alt=]] smallimage = [[ملف:Replacement filing cabinet.svg|25px|link=|alt=]] |
smallimageright
smallimageright = [[ملف:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
![]() | small = left imageright = [[ملف:Gnome globe current event.svg|50px|alt=Clock over a larger globe]] smallimageright = none |
smalltext
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 { } 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> }}
![]() | Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces }}. And now a pipe and end braces |}}. |
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls {{ambox/core}} which holds most of the code for {{ambox}}, while {{ambox}} itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below. Since this template works almost exactly like {{tmbox}}, {{imbox}}, {{cmbox}} and {{ombox}} their talk pages and related pages might also contain more details.
There are several meta-templates in the mbox family:
Closely related meta-templates:
Other pages:
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.