Template:Alert/doc: Difference between revisions
+ see also |
rewrite; emphasize (hopefully) usage as a metatemplate |
||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{Dochead|header=metatemplate}} | {{Dochead|header=metatemplate}}{{Template rating|{{PAGENAME}}|rating=ready}}{{clear}}{{templatestyles}} | ||
{{Template rating|{{PAGENAME}}|rating=ready}} | |||
The '''Alert''' template is a metatemplate which is used to create alerts, also known as callouts or admonitions, to call attention to critical information. It is intended to be used in other templates for messages which are expected to be used on multiple pages. | The '''Alert''' template is a metatemplate which is used to create alerts, also known as callouts or admonitions, to call attention to critical information. It is intended to be used in other templates for messages which are expected to be used on multiple pages. | ||
=== Usage === | === Usage === | ||
The template accepts | The template accepts the following parameters: | ||
* <code>type</code>: Defines the color of the left border; the type should be chosen according to context, not for aesthetic reasons. Types are described in the next section. | * <code>type</code>: Defines the color of the left border; the type should be chosen according to context, not for aesthetic reasons. Types are described in the next section. | ||
* <code>text</code>: Message to be displayed in the box. | * <code>text</code>: Message to be displayed in the box. | ||
* <code>icon</code>: Icon to be displayed in the box, if provided. Icons appear on the left side of the message box. | * <code>icon</code>: Icon to be displayed in the box, if provided. Icons appear on the left side of the message box. Unlike mbox, alert uses an {{w|emoji}} rather than an image, which should be passed in using its {{w|HTML entity}} representation (e.g. use <code>&#x1F642;</code> for 🙂</code>). | ||
* <code> | * <code>label</code>: A custom label, if provided. | ||
Templates that use this metatemplate (namely <code><nowiki>{{note}}</nowiki></code>, <code><nowiki>{{tip}}</nowiki></code>, and <code><nowiki>{{warning}}</nowiki></code>) should have pre-assigned values for <code>type</code>, <code>icon</code>, and <code>label</code>, leaving only <code>text</code> available to be modified. | |||
=== Types and examples === | === Types and examples === | ||