Template:WarnAlt: Difference between revisions
(testing) |
(subst for debugging) |
||
Line 2: | Line 2: | ||
{{#switch: {{{severity| {{{1|}}} }}} | {{#switch: {{{severity| {{{1|}}} }}} | ||
| #default = The severity argument is required. | | #default = The severity argument is required. | ||
| note|1 = {{ | | note|1 = {{#switch: {{{size| {{{2|}}} }}} | ||
| caution|2 = {{User:lyiriyah/sandbox/warn/caution| {{{size| {{{2|}}} }}} | {{{message | | #default = Size argument is required. | ||
| warning|3 = {{User:lyiriyah/sandbox/warn/warning| {{{size| {{{2|}}} }}} | {{{message | | large|3 = <div style="background-color:#f8f9fa; padding: 1.2rem; margin-top: 0.5em; border: 1px solid #4666c8; border-top-color:4666c8 ; border-top-width: .4rem; border-radius: .20rem; box-shadow: 2px 2px #F7F8F9;">[[File:OOjs UI icon information-progressive.svg|35px|left|link=]]'''NOTE''' {{{message {{{3|}}} }}} </div> | ||
| danger|4 = {{User:lyiriyah/sandbox/warn/danger| {{{size| {{{2|}}} }}} | {{{message | | medium|med|2 = <table cellspacing="0" cellpadding="0" border="0" style="margin-top:0.5em; border:1px #4666c8 solid; padding:0.5em; background-color:#f8f9fa"><tr><td nowrap="true" valign="top"> | ||
[[File:OOjs UI icon information-progressive.svg|18px|text-bottom|alt=NOTE]] '''NOTE''' {{{message {{{3|}}} }}} </table> | |||
| small|1 = [[File:OOjs UI icon information-progressive.svg|18px|text-bottom|alt=NOTE]] '''NOTE''' {{{message {{{3|}}} }}} | |||
}} | |||
| caution|2 = {{subst:User:lyiriyah/sandbox/warn/caution| {{{size| {{{2|}}} }}} | {{{message {{{3|}}} }}} }} | |||
| warning|3 = {{subst:User:lyiriyah/sandbox/warn/warning| {{{size| {{{2|}}} }}} | {{{message {{{3|}}} }}} }} | |||
| danger|4 = {{subst:User:lyiriyah/sandbox/warn/danger| {{{size| {{{2|}}} }}} | {{{message {{{3|}}} }}} }} | |||
}} | }} | ||
<noinclude> | <noinclude> | ||
{{User:lyiriyah/sandbox/warn/doc}} | {{User:lyiriyah/sandbox/warn/doc}} | ||
</noinclude> | </noinclude> |
Revision as of 14:42, 11 February 2022
The severity argument is required.
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 |