Template:Alert: Difference between revisions

From Step Mods | Change The Game
m (Text replacement - "chartreuse" to "chartr")
mNo edit summary
Line 1: Line 1:
<includeonly>{{#vardefine:color|{{#switch:{{lc:{{{type|}}}}}
{{TOC}}<includeonly>{{#vardefine:color|{{#switch:{{lc:{{{type|}}}}}
|bug=mgreen
|bug=mgreen
|construction=mpurple
|wip
|mcm=myellow
|construction=morange
|mo=mblue
|loot=myellow
|mcm=msalmon
|mo2
|mo=mpurple
|note
|notice=mblue
|notice=mblue
|warn
|warning=mred
|warning=mred
|#default=mblue}}}}{| class="{{{bgcolor|{{#var:color}}}}}bg stepalert hltx neutbd" style="width:{{#if:{{{size|}}}|{{#switch:{{{size|}}}
|#default=mblue}}}}<div class="{{{bgcolor|{{#var:color}}}}}bg d-flex mx-5 my-3 stepalert neutbd hltx">[[File:{{#switch:{{{icon|{{lc:{{{type}}}}}}}}
|max=70
|mid=55
|min=30
|#default={{{size}}}}}|80}}%;"
! rowspan="2" | [[File:{{#switch:{{{icon|{{lc:{{{type}}}}}}}}
|bug=Bug-Logo.png
|bug=Bug-Logo.png
|wip
|construction=Weapon.png
|construction=Weapon.png
|loot=loot.png
|mcm=Mcmicon1.png
|mcm=Mcmicon1.png
|mo2
|mo=Moicon.png
|mo=Moicon.png
|note
|notice=Info-Logo.png
|notice=Info-Logo.png
|warn
|warning=Warning-Logo.png
|warning=Warning-Logo.png
|#default={{{icon|Info-Logo.png}}}}}|35px]] !! {{#switch:{{lc:{{{type|}}}}}
|#default={{{icon|Info-Logo.png}}}}}|35px]]<div class="ml-2"><p class="h4">'''{{#switch:{{{type|}}}
|bug=Bug
|bug=BUG
|construction=Under Construction
|wip
|mcm=Mod Configuration Menu
|construction=WIP
|mo=MO Users
|loot=LOOT
|notice=Notice
|mcm=MCM
|warning=Warning
|mo2
|#default=Notice}}:
|mo=MO2
|-
|note
| {{{text}}}
|notice=NOTE
|}
|warn
</includeonly><noinclude>__NOTOC__[[Category:Notification Templates]]
|warning=WARNING
|#default=NOTE}}'''</p>
{{{text}}}</div></div></includeonly><noinclude>


== Purpose & Usage ==
== Purpose & Usage ==
This template displays a blocked out "alert" on the page.
This template displays a standard and prominent alert message. This alert should be used sparingly and is NOT intended for use within lists. For brief and prominent alerts suitable for use within lists, use [[:Template:AlertSmall]] instead.


=== Required Parameters ===
=== Required Parameters ===
; type
<span class="salmontx">'''type'''</span> - Sets the type of alert, which dictates icon and color
: Defined: <code>type=''keyword''</code>
: '''Values'''
: Determines the style of alert to display. The options are:
:: Default: <code>type=notice</code>
::* '''bug''' : a general bug notice.
:* bug
::* '''construction''' : an "under construction" alert.
:* wip or construction - work in progress
::* '''mcm''' : a MCM notice.
:* loot - LOOT specific
::* '''mo''' : a Mod Organizer user notice.
:* mcm - Mod Confuguration Manager specific
::* '''notice''' : a general notice.
:* mo or mo2 - Mod Organizer 2 specific
::* '''warning''' : a warning.
:* ''note'' or ''notice''
:* warn or warning


; text
<span class="salmontx">'''text'''</span> - The alert message
: Defined: <code>text=''textHere''</code>
: '''Values'''
: Defines the content for the notification. Most formatting is accepted.
:: Default: n/a, <code>text=''ContentHere''</code>


=== Optional Parameters ===
=== Optional Parameters ===
; size
<span class="salmontx">'''icon'''</span> - Determines the icon used
: Defined: <code>size=''value''</code>
: '''Values'''
: Default: ''max''
:: Default: <code>icon=notice</code>
: Determines the width by percentage. Accepts any integer from 0 - 100, but standard sizes are preferred using the appropriate keyword:
:* bug
::* '''min''' = 30%
:* wip or construction
::* '''mid''' = 55%
:* loot
::* '''max''' = 70%
:* mcm
:* mo or mo2
:* ''note'' or ''notice''
:* warn or warning


;icon
==Examples==
: Defined: <code>icon=''image.png''</code>
===Default Call===
: Default: ''Info-Logo.png''
The simplest call returns defaults for the template.
: Sets the icon image. This is set automatically if using one of the predefined types, but can be overridden here.
: '''Code:''' <code><nowiki>{{Alert|text=Your text here.}}</nowiki></code>
 
;bgcolor
: Defined: <code>bgcolor=''color''</code>
: Default: ''blue''
: Sets the background color. This is set automatically if using one of the predefined types, but can be overridden here. Keywords available are:
::* {{Fc|magenta|magent}}
::* {{Fc|purple|purple}}
::* {{Fc|blue|blue}}
::* {{Fc|green|green}}
::* {{Fc|chartr|chartr}}
::* {{Fc|yellow|yellow}}
::* {{Fc|orange|orange}}
::* {{Fc|salmon|salmon}}
::* {{Fc|red|red}}
 
== Examples ==
=== General Notice ===
This is the template's default thus leaving the '''type''' parameter out will result in a general notification. Thus the following two codings will have the same results:
: '''Code:''' <code><nowiki>{{Alert|text=Your text here.}}</nowiki></code><br>
: '''Code:'''
<pre>{{Alert|type=notice|text=Your text [[here]], and it's a lot of text with a list even:
* list item 1
* list item 2
... and that's it.}}
</pre><br>
: '''Result:'''
: '''Result:'''
{{Alert|type=notice|text=Your text [[here]], and it's a lot of text with a list even:
:: {{Alert|text=Your text here.}}
* list item 1
:: {{Alert|text=Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam condimentum pretium tellus nec scelerisque. Nam nisi magna, venenatis at nibh quis, consequat pretium velit. Mauris fringilla mollis molestie. Fusce tellus justo, tempor id efficitur non, dapibus eu nunc. Integer nec hendrerit diam. Quisque aliquet nunc id vestibulum tincidunt. Vivamus dictum rutrum dolor auctor commodo.}}
* list item 2
... and that's it.}}


=== Bug ===
=== Including Lists ===
: '''Code:''' <code><nowiki>{{Alert|type=bug|text=Your text here.}}</nowiki></code><br>
: '''Code:'''
<pre>{{Alert|text=Using wiki markup like lists with this alert is appropriate.
# For numbered
#* Bulleted
#: or mixed lists
Behavior should mimic body text.
}}</pre>
: '''Result:'''
: '''Result:'''
{{Alert|type=bug|text=Your text here.}}
:: {{Alert|text=Using wiki markup like lists with this alert is appropriate.
# For numbered
#* Bulleted
#: or mixed lists
Behavior should mimic body text.
}}


=== Construction ===
=== Types ===
: '''Code:''' <code><nowiki>{{Alert|type=construction|text=Your text here.}}</nowiki></code><br>
The simplest call returns defaults for the template.
: '''Code:''' <code><nowiki>{{Alert|type=bug|text=Your text here.}}</nowiki></code>
: '''Result:'''
: '''Result:'''
{{Alert|type=construction|text=Your text here.}}
:: {{Alert|type=bug|text=Bug message}}
:: {{Alert|type=wip|text=Under construction (WIP) message}}
:: {{Alert|type=loot|text=Loot-specific message}}
:: {{Alert|type=mcm|text=MCM-specific message}}
:: {{Alert|type=mo|text=MO2-specific message}}
:: {{Alert|type=warn|text=Warning message}}


=== MCM ===
== Related Templates ==
: '''Code:'''  <code><nowiki>{{Alert|type=mcm|text=Your text here.}}</nowiki></code><br>
*[[:Template:AlertSmall]] - A more subtle version suitable for brief messages or messages within lists.
: '''Result:'''
{{Alert|type=mcm|text=Your text here.}}


=== Mod Organizer ===
</noinclude>
: '''Code:'''  <code><nowiki>{{Alert|type=mo|text=Your text here.}}</nowiki></code><br>
: '''Result:'''
{{Alert|type=mo|text=Your text here.}}
 
=== Warning ===
: '''Code:'''  <code><nowiki>{{Alert|type=warning|text=Your text here.}}</nowiki></code><br>
: '''Result:'''
{{Alert|type=warning|text=Your text here.}}
 
=== Adjusting the Size ===
Altering the size (%) using a defined keyword.<br>
: '''Code:'''  <code><nowiki>{{Alert|type=warning|size=mid|text=Your text here.}}</nowiki></code><br>
: '''Result:'''
{{Alert|type=warning|size=mid|text=Your text here.}}
 
Explicitly define a size (%) using an integer between 0 - 100.
: '''Code:'''  <code><nowiki>{{Alert|type=warning|size=25|text=Your text here.}}</nowiki></code>
: '''Result:'''
{{Alert|type=warning|size=25|text=Your text here.}}
 
== Related Templates ==
*[[:Template:AlertSmall]] - A smaller and more condensed version (can be used in lists).

Revision as of 20:10, July 25, 2021

Purpose & Usage[edit source]

This template displays a standard and prominent alert message. This alert should be used sparingly and is NOT intended for use within lists. For brief and prominent alerts suitable for use within lists, use Template:AlertSmall instead.

Required Parameters[edit source]

type - Sets the type of alert, which dictates icon and color

Values
Default: type=notice
  • bug
  • wip or construction - work in progress
  • loot - LOOT specific
  • mcm - Mod Confuguration Manager specific
  • mo or mo2 - Mod Organizer 2 specific
  • note or notice
  • warn or warning

text - The alert message

Values
Default: n/a, text=ContentHere

Optional Parameters[edit source]

icon - Determines the icon used

Values
Default: icon=notice
  • bug
  • wip or construction
  • loot
  • mcm
  • mo or mo2
  • note or notice
  • warn or warning

Examples[edit source]

Default Call[edit source]

The simplest call returns defaults for the template.

Code: {{Alert|text=Your text here.}}
Result:
Info-Logo.png

NOTE

Your text here.
Info-Logo.png

NOTE

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam condimentum pretium tellus nec scelerisque. Nam nisi magna, venenatis at nibh quis, consequat pretium velit. Mauris fringilla mollis molestie. Fusce tellus justo, tempor id efficitur non, dapibus eu nunc. Integer nec hendrerit diam. Quisque aliquet nunc id vestibulum tincidunt. Vivamus dictum rutrum dolor auctor commodo.

Including Lists[edit source]

Code:
{{Alert|text=Using wiki markup like lists with this alert is appropriate.
# For numbered
#* Bulleted
#: or mixed lists
Behavior should mimic body text.
}}
Result:
Info-Logo.png

NOTE

Using wiki markup like lists with this alert is appropriate.

  1. For numbered
    • Bulleted
    or mixed lists
Behavior should mimic body text.

Types[edit source]

The simplest call returns defaults for the template.

Code: {{Alert|type=bug|text=Your text here.}}
Result:
Bug-Logo.png

BUG

Bug message
Weapon.png

WIP

Under construction (WIP) message
Loot.png

LOOT

Loot-specific message
Mcmicon1.png

MCM

MCM-specific message
Moicon.png

MO2

MO2-specific message
Warning-Logo.png

WARNING

Warning message

Related Templates[edit source]

  • Template:AlertSmall - A more subtle version suitable for brief messages or messages within lists.