Template:WarnAlt/doc: Difference between revisions

From Caps Wiki
Jump to navigation Jump to search
(new template data at Template:WarnAlt)
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:
The visual editor provides a nice popup box where you can fill in all the data, but the same arguments apply.
The visual editor provides a nice popup box where you can fill in all the data, but the same arguments apply.


<!--
==TemplateData==
<templatedata>
<templatedata>
{
{
"description": "Add warnings about possible dangers",
"params": {
"params": {
"severity": {
"severity": {
"description": "Severity of the warning. Can be note, caution, warning or danger.",
"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,
"required": true,
"aliases": [
            "aliases": [ "1" ]
"1"
],
"type": "string"
},
},
"size": {
"size": {
"description": "Size of the warning. Can be large, medium, med or small",
"label": "Warning Box Size",
"description": "The size or type of the warning to be created.",
            "example": "large, medium, small",
"type": "string",
"required": true,
"required": true,
"aliases": [
            "aliases": [ "2" ]
"2"
],
"type": "string"
},
},
"message": {
"message": {
"description": "The message to show in the warning box.",
"label": "Displayed Text",
"description": "The text to be displayed in the warning box.",
"example": "Caps may retain charge after poweroff",
"type": "string",
"required": true,
"required": true,
"aliases": [
            "aliases": [ "3" ]
"3"
},
],
"custom_label": {
"type": "string"
"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>
</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

Template parameters

ParameterDescriptionTypeStatus
Severity and Colorseverity 1

The severity of the warning that will also determine the color of the warning.

Example
danger, warning, caution, note, custom
Stringrequired
Warning Box Sizesize 2

The size or type of the warning to be created.

Example
large, medium, small
Stringrequired
Displayed Textmessage 3

The text to be displayed in the warning box.

Example
Caps may retain charge after poweroff
Stringrequired
Custom Labelcustom_label

A custom label to be displayed before the message. Required when ''severity'' is set to ''custom''.

Example
ACHTUNG
Stringoptional
Custom Iconcustom_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.

Example
OOjs UI icon laptop-progressive.svg
Stringoptional