Template:Imbox
From Wikibooks, the open-content textbooks collection
Contents |
Usage
This is the {{imbox}} or image message box meta-template.
It is used to build message box templates for image pages. It offers several different colours, uses default images if no image parameter is given and it has some other features.
Usage
Simple usage example:
{{imbox | text = Some text.}}
Complex example:
{{imbox
| type = query
| image = [[Image:Emblem-question-yellow.svg|40px]]
| style = width: 400px;
| textstyle = color: red; font-weight: bold; font-style: italic;
| text = The message body text.
}}
Image message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type. The names were changed around to go with what's used on {{mbox}} here please note.
Other images
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.
Special
Some other parameter combinations.
Technical details
This template uses CSS classes.
If you need to use special characters in the text parameter then you need to escape them like this:
{{imbox
| 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>
}}
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.