Template:Alert: Difference between revisions

From Step Mods | Change The Game
mNo edit summary
(Separated the values more distinctly. Added ''Starfield'' as the first game parameter. Added small images to the ''Icon Optional'' list. Fixed the broken ''Including Lists'' example.)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:color|{{#switch:{{lc:{{{type|}}}}}
<includeonly>{{#vardefine:color|{{#switch:{{lc:{{{type|}}}}}
|bug=mgreen
|bug=mutegreen
|construction=mpurple
|wip
|mcm=myellow
|construction=muteorange
|mo=mblue
|loot=muteyellow
|notice=mblue
|mcm=mutesalmon
|warning=mred
|mo2
|#default=mblue}}}}{| class="{{{bgcolor|{{#var:color}}}}}bg stepalert hltx neutbd" style="width:{{#if:{{{size|}}}|{{#switch:{{{size|}}}
|mo=mutepurple
|max=70
|note
|mid=55
|notice=muteblue
|min=30
|starfield=muteblue
|#default={{{size}}}}}|70}}%;"
|warn
! rowspan="2" | [[File:{{#switch:{{{icon|{{lc:{{{type}}}}}}}}
|warning=mutered
|#default=muteblue}}}}<div class="{{{bgcolor|{{#var:color}}}}}bg d-flex mx-5 my-3 stepalert neutbd hltx">[[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
|starfield=StarfieldIcon.png
|warn
|warning=Warning-Logo.png
|warning=Warning-Logo.png
|#default={{{icon|Info-Logo.png}}}}}|40px]] !! {{#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
|}
|starfield=Starfield
</includeonly><noinclude>__NOTOC__[[Category:Notification Templates]]
|warn
|warning=WARNING
|#default=NOTE}}'''</p>
{{{text}}}</div></div></includeonly><noinclude>__NOTOC__[[Category:Notification Templates]][https://stepmodifications.org/forum/topic/15292-alert/ '''Forum Topic''']


== 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>
: '''General 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.
:* ''note'' or ''notice''
::* '''mcm''' : a MCM notice.
:* ''warn'' or ''warning''
::* '''mo''' : a Mod Organizer user notice.
:* ''wip'' or ''construction'' - work in progress
::* '''notice''' : a general notice.
: '''Tool Values'''
::* '''warning''' : a warning.
:* loot - LOOT
:* mcm - Mod Confuguration Manager
:* mo - Mod Organizer
: '''Game Values'''
:* starfield - Starfield


; 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: <span class="orangetx">''none''</span>
:: <code>text=''ContentHere''</code>


=== Optional Parameters ===
=== Optional Parameters ===
; size
<span class="salmontx">'''icon'''</span> - Determines the icon used.
: Defined: <code>size=''value''</code>
:: ''There is no reason to include this unless a custom alert is being created, in which case it would be best to expand the template to include the custom alert; to be determined on a case by case basis.''
: Default: ''max''
: Determines the width by percentage. Accepts any integer from 0 - 100, but standard sizes are preferred using the appropriate keyword:
::* '''min''' = 30%
::* '''mid''' = 55%
::* '''max''' = 70%


;icon
: '''General Values'''
: Defined: <code>icon=''image.png''</code>
:: Default: <code>icon=notice</code>
: Default: ''Info-Logo.png''
:* ''bug'' = [[File:Bug-Logo.png|20px|]]
: Sets the icon image. This is set automatically if using one of the predefined types, but can be overridden here.
:* ''note'' or ''notice'' = [[File:Info-Logo.png|20px|]]
:* ''warn or ''warning = [[File:Warning-Logo.png|20px|]]
:* ''wip'' or ''construction'' = [[File:Weapon.png|20px|]]
: '''Tool Values'''
:* ''loot'' = [[File:loot.png|20px|]]
:* ''mcm'' = [[File:Mcmicon1.png|20px|]]
:* ''mo'' = [[File:Moicon.png|20px|]]
: '''Game Values'''
:* starfield = [[File:StarfieldIcon.png|20px|]]


;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|chartreuse|chartr}}
::* {{Fc|yellow|yellow}}
::* {{Fc|orange|orange}}
::* {{Fc|salmon|salmon}}
::* {{Fc|red|red}}


== Examples ==
==Examples==
=== General Notice ===
===Default Call===
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:
The simplest call returns defaults for the template.
: '''Code:''' <code><nowiki>{{Alert|text=Your text here.}}</nowiki></code><br>
: '''Code:''' <code><nowiki>{{Alert|text=Your text here.}}</nowiki></code>
: '''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=warn|text=Warning 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=MO-specific message}}
{{Alert|type=starfield|text=Starfield-specific 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 ===
: '''Code:'''  <code><nowiki>{{Alert|type=mo|text=Your text here.}}</nowiki></code><br>
: '''Result:'''
{{Alert|type=mo|text=Your text here.}}


=== Warning ===
</noinclude>
: '''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).

Latest revision as of 03:38, November 9, 2023

Forum Topic

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

General Values
Default: type=notice
  • bug
  • note or notice
  • warn or warning
  • wip or construction - work in progress
Tool Values
  • loot - LOOT
  • mcm - Mod Confuguration Manager
  • mo - Mod Organizer
Game Values
  • starfield - Starfield

text - The alert message

Values
Default: none
text=ContentHere

Optional Parameters[edit source]

icon - Determines the icon used.

There is no reason to include this unless a custom alert is being created, in which case it would be best to expand the template to include the custom alert; to be determined on a case by case basis.
General Values
Default: icon=notice
  • bug = Bug-Logo.png
  • note or notice = Info-Logo.png
  • warn or warning = Warning-Logo.png
  • wip or construction = Weapon.png
Tool Values
  • loot = Loot.png
  • mcm = Mcmicon1.png
  • mo = Moicon.png
Game Values
  • starfield = StarfieldIcon.png


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
Warning-Logo.png

WARNING

Warning message
Weapon.png

WIP

Under construction (WIP) message
Loot.png

LOOT

Loot-specific message
Mcmicon1.png

MCM

MCM-specific message
Moicon.png

MO2

MO-specific message
StarfieldIcon.png

Starfield

Starfield-specific message

Related Templates[edit source]

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