Template:Xambox/doc
This is a documentation subpage for Template:Xambox It contains usage information, categories and other content that is not part of the original template page. |
Usage
editThis template creates an explicit ambox; that is, an article message box that always actually presents its message to the user, even in mobile view. Use it when the reader should see the actual message. (Wikipedia, for which {{ambox}} is apparently maintained, is primarily concerned with delivering content regardless of quality, while explaining what needs improvement as a follow-up concern; though consistent with Wikipedia's workflow, this is not always appropriate, and on some projects may even be usually inappropriate depending on their workflow. Currently, {{ambox}} on mobile view shows a discreet message "Page Issues" which can be clicked on to see what the issues are.)
This template generates two boxes, one for the desktop view and a second for the mobile view; one or the other should be hidden via css.
The desktop box draws its primary content from parameter text
if available, otherwise parameter text-mobile
if available. The mobile box looks for text-mobile
first, otherwise text
.
Parameter type
if provided determines the color of the border and bar on the left side of the box, and may determine the left image. Parameter type
if omitted or blank defaults to notice
. As of this writing, the types with associated colors are
notice
,serious
,content
,style
,merge
,
while those with associated images are
serious
,content
,maintenance
,notice
,blank
.
The desktop box takes optional parameters image
and imageright
to specify images (or other content) to the left and to the right of the text. If image
is omitted, the left image defaults to some image based on type
; if image
is blank, space is left as if there were an image (allowing multiple messages to align); image=none
omits the left image. The right image is omitted unless explicitly specified.
The mobile box uses instead optional parameters image-mobile
and imageright-mobile
. If image-mobile
is unspecified it defaults to none, if blank it defaults to an image based on type
.
If parameter noprint
is non-blank, the boxes also have class noprint
.
Internals
editThe desktop box is wrapped in a div element of class desktop-only, the mobile box in a div element of class mobile-only; there should be a rule in Mediawiki:Common.css hiding elements of class mobile-only, and in Mediawiki:Mobile.css hiding elements of class desktop-only.