Template:WarnAlt/doc: Difference between revisions
m (Lyiriyah moved page User:Lyiriyah/sandbox/warn/doc to Template:WarnAlt/doc: For testing TemplateData) |
|||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
==Documentation== | |||
This template is an intended replacement for the <code><nowiki>{{</nowiki>[[Template:warn|warn]]<nowiki>}}</nowiki></code> template. It has four different severity levels and three different sizes, which are demonstrated [[Template:WarnAlt/test|here]]. | |||
===Syntax=== | |||
For the source editor, the syntax is <code><nowiki>{{WarnAlt|<note|caution|warning|danger>|<large|medium/med|small>|<message>}}</nowiki></code>.<br> | |||
The visual editor provides a nice popup box where you can fill in all the data, but the same arguments apply. | |||
==TemplateData== | |||
<templatedata> | |||
{ | |||
"params": { | |||
"severity": { | |||
"label": "Severity and Color", | |||
"description": "The severity of the warning that will also determine the color of the warning.", | |||
"example": "danger, warning, caution, note, custom", | |||
"type": "string", | |||
"required": true, | |||
"aliases": [ "1" ] | |||
}, | |||
"size": { | |||
"label": "Warning Box Size", | |||
"description": "The size or type of the warning to be created.", | |||
"example": "large, medium, small", | |||
"type": "string", | |||
"required": true, | |||
"aliases": [ "2" ] | |||
}, | |||
"message": { | |||
"label": "Displayed Text", | |||
"description": "The text to be displayed in the warning box.", | |||
"example": "Caps may retain charge after poweroff", | |||
"type": "string", | |||
"required": true, | |||
"aliases": [ "3" ] | |||
}, | |||
"custom_label": { | |||
"label": "Custom Label", | |||
"description": "A custom label to be displayed before the message. Required when ''severity'' is set to ''custom''.", | |||
"example": "ACHTUNG", | |||
"type": "string", | |||
"required": false | |||
}, | |||
"custom_icon": { | |||
"label": "Custom Icon", | |||
"description": "An image file to be displayed as an icon before the label. Required when ''severity'' is set to ''custom''. Do not include ''File:''. Since the custom option displays in a blue theme, blue-colored icons are suggested.", | |||
"example": "OOjs UI icon laptop-progressive.svg", | |||
"type": "string", | |||
"required": false | |||
} | |||
}, | |||
"description": "Create a warning box to get the users attention" | |||
} | |||
</templatedata> |
Latest revision as of 22:21, 17 February 2022
Documentation
This template is an intended replacement for the {{warn}}
template. It has four different severity levels and three different sizes, which are demonstrated here.
Syntax
For the source editor, the syntax is {{WarnAlt|<note|caution|warning|danger>|<large|medium/med|small>|<message>}}
.
The visual editor provides a nice popup box where you can fill in all the data, but the same arguments apply.
TemplateData
Create a warning box to get the users attention
Parameter | Description | Type | Status | |
---|---|---|---|---|
Severity and Color | severity 1 | The severity of the warning that will also determine the color of the warning.
| String | required |
Warning Box Size | size 2 | The size or type of the warning to be created.
| String | required |
Displayed Text | message 3 | The text to be displayed in the warning box.
| String | required |
Custom Label | custom_label | A custom label to be displayed before the message. Required when ''severity'' is set to ''custom''.
| String | optional |
Custom Icon | custom_icon | An image file to be displayed as an icon before the label. Required when ''severity'' is set to ''custom''. Do not include ''File:''. Since the custom option displays in a blue theme, blue-colored icons are suggested.
| String | optional |