Format:Meta-casetămc/doc
|
This is the {{cmbox}} or category message box meta-template.
It is used to build message box templates for category pages, such as {{CatDiffuse}} etc. It offers several different colours, uses default imagines if no imagine parameter is given and it has some other features.
This template works almost exactly like {{ambox}} and uses the same parameters.
We are deploying!
[modificare]After long discussion on the talk page of this template and at other places we are finally deploying this template. Feel free to convert any message boxes used on category pages to use this meta-template. If you find any tricky cases then list them on the talk page of this template and you'll get help.
When this template is used to build category message boxes those boxes should contain explanatory mesajs just like before. (The same mesajs as before or new improved mesajs.) If there are more specific imagines in the boxes or you know a better imagine, then use them instead of the default imagines shown here.
Usage
[modificare]Simple usage example:
{{cmbox | mesaj = Some mesaj.}}
Some mesaj. |
Complex example:
{{cmbox | tip = stil | imagine = [[Image:Emblem-question-yellow.svg|40px]] | style = width: 400px; | mesajstyle = color: red; font-weight: bold; font-style: italic; | mesaj = The message body mesaj. }}
The message body mesaj. |
Category message box tips
[modificare]The following examples use different tip parameters but use no imagine parameters thus they use the default imagines for each tip.
tip=rapid – Speedy deletion templates such as {{db-catempty}}. |
tip=şterge – Deletion templates such as {{cfd}}. |
tip=content – Major warnings and problems, such as {{CategorisationDisputedPeople}}. |
tip=style – Minor warnings and problems, such as {{popcat}}. |
tip=notificare – Notices and messages of any kind, both permanent and temporary. |
tip=mută – Move, merge and split messages and proposals, such as {{categoryredirect}}. |
tip=protecţie – Protection templates such as {{pp-semi-protected}} when shown on a category page. |
Other imagines
[modificare]The default imagines shown above are mostly for convenience. In many cases it is more appropriate to use more specific imagines. These examples use the imagine parameter to specify an imagine other than the default imagines.
tip = style imagine = [[Image:Sub-arrows.svg|40px]] This imagine is used for {{verylarge}} and {{CatDiffuse}}. |
tip = mută imagine = [[Image:Redirect arrow.svg|52px]] This imagine is used for {{categoryredirect}}. |
Special
[modificare]Some other parameter combinations.
No tip and no imagine given (default) |
No tip and imagine=none – No imagine is used and the mesaj uses the whole message box area. |
imagine = [[Image:Gnome globe current event.svg|42px]] imaignedreapta = [[Image:Nuvola apps bookcase.svg|40px]] |
This category lists articles about current and recent spaceflights.
It is populated by the {{current spaceflight}} template. |
Parameters
[modificare]List of all parameters:
{{cmbox | tip = rapid / şterge / content / style / notificare / mută / protecţie | imagine = none / [[Image:Some imagine.svg|40px]] | imaignedreapta = [[Image:Some imagine.svg|40px]] | style = CSS value | textstyle = CSS value | mesaj = The message body mesaj. }}
tip
- If no tip parameter is given the template defaults to tip notificare. That means it gets a blue background.
imagine
- No parameter = If no imagine parameter is given the template uses a default imagine. Which default imagine it uses depends on the tip parameter.
- An imagine = Should be an imagine with usual wiki notation. 40px - 50px width are usually about right depending on the imagine height to width ratio. (Images over 52 pixels width will cause padding problems.) For example:
imagine = [[Image:Sub-arrows.svg|40px]]
- none = Means that no imagine is used.
imaignedreapta
- No parameter = If no imaignedreapta parameter is given then no imagine is shown on the right side.
- An imagine = Should be an imagine with usual wiki notation. 40px - 50px width are usually about right depending on the imagine height to width ratio. (But on this side the message box can handle imagines of any size.) For example:
imaignedreapta = [[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 mesaj cell. For example:
mesajstyle = mesaj-align: center;
mesaj
- The message body mesaj.
Technical details
[modificare]If you need to use special characters in the mesaj parameter then you need to escape them like this:
{{cmbox | mesaj = <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 |}}. |
This template uses the cmbox CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
Internally this meta-template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta-templates since wiki markup has several drawbacks. For instance it makes it harder to use parser functions and special characters in parameters.
The default imagines 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 imagines. The png imagines 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. Since this template works almost exactly like {{ambox}} and {{imbox}} their talk pages and related pages might also contain more details.