Format:Meta-casetămc

(Redirecționat de la Format:Cmbox)
Documentaţie
Documentaţie format
Această documentaţie este adusă de la pagina 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!

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

Simple usage example:

{{cmbox | 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.
}}

Category message box tips

The following examples use different tip parameters but use no imagine parameters thus they use the default imagines for each tip.

Other imagines

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.

Special

Some other parameter combinations.

Parameters

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

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>
}}


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.