Difference between revisions of "Template:Alerts"
m (Protected "Template:Alerts" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
|||
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{#switch: {{{1|}}} | + | <onlyinclude>{{#switch: {{{1|}}} |
| warning = | | warning = | ||
− | <div class="alert alert-warning" role="alert">{{#if: {{{title|}}}|<h4 class="alert-heading">{{{title|}}}</h4>|}} | + | <div class="alert alert-warning" role="alert">{{#if: {{{title|}}}|<h4 class="alert-heading">{{{title|}}}</h4>|}}{{{2|}}}</div> |
| danger = | | danger = | ||
− | <div class="alert alert-danger" role="alert">{{#if: {{{title|}}}|<h4 class="alert-heading">{{{title|}}}</h4>|}} | + | <div class="alert alert-danger" role="alert">{{#if: {{{title|}}}|<h4 class="alert-heading">{{{title|}}}</h4>|}}{{{2|}}}</div> |
| dark = | | dark = | ||
− | <div class="alert alert-dark" role="alert">{{#if: {{{title|}}}|<h4 class="alert-heading">{{{title|}}}</h4>|}} | + | <div class="alert alert-dark" role="alert">{{#if: {{{title|}}}|<h4 class="alert-heading">{{{title|}}}</h4>|}}{{{2|}}}</div> |
|#default = | |#default = | ||
− | <div class="alert alert-light" role="alert">{{#if: {{{title|}}}|<h4 class="alert-heading">{{{title|}}}</h4>|}} | + | <div class="alert alert-light" role="alert">{{#if: {{{title|}}}|<h4 class="alert-heading">{{{title|}}}</h4>|}}{{{1|}}}</div> |
− | }} | + | }}</onlyinclude> |
<noinclude> | <noinclude> | ||
<div class="row template-documentation"> | <div class="row template-documentation"> | ||
− | + | <div class="col-12"> | |
− | + | <h2>Template Documentation</h2> | |
− | + | <p>Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.</p> | |
− | + | </div> | |
− | + | <div class="col-12"> | |
− | + | <h4>Usage</h4> | |
− | + | <p>This template can be used to provide an alert textbox in 4 contextual cases. This template can display the following alerts:</p> | |
− | + | <ol> | |
− | + | <li>A warning alert</li> | |
− | + | <li>A danger alert</li> | |
− | + | <li>A dark alert</li> | |
− | + | <li>And a normal alert</li> | |
− | + | </ol> | |
− | + | </div> | |
− | + | <div class="col-12"> | |
− | + | ==== Examples ==== | |
− | + | ===== The Classic Light Alert ===== | |
− | + | The following displays the light alert text box. You can follow this with whatever text/images/markup you like. | |
− | + | ||
− | + | Wiki code: | |
− | + | <pre>{{Alerts|A simple light alert—check it out!}}</pre> | |
− | + | {{Alerts|A simple light alert—check it out!}} | |
− | + | ||
+ | ===== The Warning Alert ===== | ||
+ | The following displays the warning alert text box. You can follow this with whatever text/images/markup you like. | ||
+ | |||
+ | Wiki code: | ||
+ | <pre>{{Alerts|warning|A simple warning alert—check it out!}}</pre> | ||
+ | {{Alerts|warning|A simple warning alert—check it out!}} | ||
+ | |||
+ | ===== The Danger Alert ===== | ||
+ | The following displays the danger alert text box. You can follow this with whatever text/images/markup you like. | ||
+ | |||
+ | Wiki code: | ||
+ | <pre>{{Alerts|danger|A simple danger alert—check it out!}}</pre> | ||
+ | {{Alerts|danger|A simple danger alert—check it out!}} | ||
+ | |||
+ | ===== The Dark Alert ===== | ||
+ | The following displays the dark alert text box. You can follow this with whatever text/images/markup you like. | ||
+ | |||
+ | Wiki code: | ||
+ | <pre>{{Alerts|dark|A simple dark alert—check it out!}}</pre> | ||
+ | {{Alerts|dark|A simple dark alert—check it out!}} | ||
+ | |||
+ | ===== Titles ===== | ||
+ | You may also include a title for the alerts. But not for the light alert. | ||
+ | |||
+ | Wiki code using the warning alert: | ||
+ | <pre>{{Alerts|warning|title=This is a simple title!|A simple warning alert—check it out!}}</pre> | ||
+ | {{Alerts|warning|title=This is a simple title!|A simple warning alert—check it out!}} | ||
+ | |||
+ | |||
+ | </div> | ||
− | |||
− | |||
</div> | </div> | ||
+ | __NOTOC__ | ||
+ | [[Category: Templates]] | ||
</noinclude> | </noinclude> |
Latest revision as of 13:29, 30 April 2020
Template Documentation
Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.
Usage
This template can be used to provide an alert textbox in 4 contextual cases. This template can display the following alerts:
- A warning alert
- A danger alert
- A dark alert
- And a normal alert
Examples
The Classic Light Alert
The following displays the light alert text box. You can follow this with whatever text/images/markup you like.
Wiki code:
{{Alerts|A simple light alert—check it out!}}
The Warning Alert
The following displays the warning alert text box. You can follow this with whatever text/images/markup you like.
Wiki code:
{{Alerts|warning|A simple warning alert—check it out!}}
The Danger Alert
The following displays the danger alert text box. You can follow this with whatever text/images/markup you like.
Wiki code:
{{Alerts|danger|A simple danger alert—check it out!}}
The Dark Alert
The following displays the dark alert text box. You can follow this with whatever text/images/markup you like.
Wiki code:
{{Alerts|dark|A simple dark alert—check it out!}}
Titles
You may also include a title for the alerts. But not for the light alert.
Wiki code using the warning alert:
{{Alerts|warning|title=This is a simple title!|A simple warning alert—check it out!}}
This is a simple title!
A simple warning alert—check it out!