Template:AlertSmall: Difference between revisions

From Step Mods | Change The Game
No edit summary
(Separated the values more distinctly. Added ''Starfield'' as the first game parameter. Added small images to the ''Icon Optional'' list.)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:color|{{#switch:{{{type}}}
<includeonly>{{#vardefine:color|{{#switch:{{{type}}}
|bug=green
|bug=green
|construction=purple
|wip
|fo3=chartr
|construction=orange
|fnv=orange
|loot=yellow
|loot=yellow
|mcm=salmon
|mcm=salmon
|mo=blue
|mo2
|mo=purple
|note
|notice=blue
|notice=blue
|starfield=blue
|warn
|warning=red
|warning=red
|#default=blue}}}}{| class="stepalertsm {{{borderColor|{{#var:color}}}}}bd" style="display:inline;width:{{#if:{{{size|}}}|{{#switch:{{lc:{{{size|}}}}}
|#default=blue}}}}<div class="d-table-cell"><div class="d-flex m-0 mt-1 px-1 stepalertsm {{{borderColor|{{#var:color}}}}}bd""><div class="alertIcon">[[File:{{#switch:{{lc:{{{icon|{{{type}}}}}}}}
|max=70
|mid=50
|min=30
|#default={{{size}}}}}%|auto}};"
! [[File:{{#switch:{{lc:{{{icon|{{{type}}}}}}}}
|bug=Bug-Logo.png
|bug=Bug-Logo.png
|wip
|construction=Weapon.png
|construction=Weapon.png
|fo3=Fallout3.png
|fnv=newvegas.png
|loot=loot.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}}}}}|20px]] !! {{#switch:{{lc:{{{alertHeader|{{{type}}}}}}}}
|#default=Info-Logo.png}}|20px]]</div><div class="ml-2 alertText hltx">'''{{#switch:{{{type|}}}
|bug=Bug
|bug=BUG
|construction=Under Construction
|wip
|fo3=Fallout 3 Specific
|construction=WIP
|fnv=Fallout NV Specific
|loot=LOOT
|loot=LOOT
|mcm=MCM
|mcm=MCM
|mo= MO Users
|mo2
|notice=Notice
|mo=MO2
|warning=Warning
|note
|#default=Notice}}:
|notice=NOTE
| {{{text}}}
|starfield=Starfield
|}</includeonly><noinclude>__NOTOC__[[Category:Notification Templates]]
|warn
|warning=WARNING
|#default=NOTE}}:'''</div><div class="ml-2 alertText"> {{{text}}}</div></div></div></includeonly><noinclude>__NOTOC__[[Category:Notification Templates]][https://stepmodifications.org/forum/topic/15294-alert-small/ '''Forum Topic''']


== Purpose & Usage ==
== Purpose & Usage ==
This template displays a small alert on the page that can be used inline within lists and lines of text, however, it will still block itself out from the text to a degree.
This template displays a small alert on the page that can also be used within lists. For this reason, this alert has all but top outer margins set to zero, so use blank lines or breaks to separate from body text where appropriate. This template is intended for use with brief alerts or alerts used within lists. For more lengthy and prominent alerts, use [[:Template:Alert]] 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'''
: Defines the type of alert to display. Keywords available are:
:: Default: <code>type=notice</code>
::* bug  
:* ''bug''
::* construction
:* ''note'' or ''notice''
::* fo3
:* ''warn'' or ''warning''
::* fnv
:* ''wip'' or ''construction'' - work in progress
::* loot
: '''ToolsValues'''
::* mcm
:* ''loot'' - LOOT specific
::* mo
:* ''mcm'' - Mod Confuguration Manager specific
::* notice
:* ''mo'' - Mod Organizer specific
::* warning
: '''Game Values'''
:* ''starfield'' - Starfield


; text
<span class="salmontx">'''text'''</span> - The alert message
: Defined: <code>text=''ContentHere''</code>
: '''Values'''
: Defines the content of the alert.
:: 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: auto
: Determines the width by percentage. Accepts any integer from 0 - 100, but standard sizes are preferred using the appropriate keyword:
:* min - 35%
:* 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|]]
; borderColor
:* ''wip'' or ''construction'' = [[File:Weapon.png|20px|]]
: Defined: <code>borderColor=''keyword''</code>
: '''Tool Values'''
: Defines the color of the border. This is set automatically if using one of the predefined types, but can be overridden here. Keywords available are:
:* ''loot'' = [[File:loot.png|20px|]]
::* {{Fc|magenta|magent}}
:* ''mcm'' = [[File:Mcmicon1.png|20px|]]
::* {{Fc|purple|purple}}
:* ''mo'' = [[File:Moicon.png|20px|]]
::* {{Fc|blue|blue}}
: '''Game Values'''
::* {{Fc|green|green}}
:* starfield = [[File:StarfieldIcon.png|20px|]]
::* {{Fc|chartreuse|chartr}}
::* {{Fc|yellow|yellow}}
::* {{Fc|orange|orange}}
::* {{Fc|salmon|salmon}}
::* {{Fc|red|red}}


== Examples ==
== Examples ==
=== Default Call ===
=== Default Call ===
The simplest call returns defaults for the template (size=70%, solid border).
The simplest call returns defaults for the template.
: '''Code:''' <code><nowiki>{{AlertSmall|text=Your text here.}}</nowiki></code>
: '''Code:''' <code><nowiki>{{AlertSmall|text=Your text here.}}</nowiki></code>
: '''Result:'''
: '''Result:'''
:: {{AlertSmall|text=Your text here.}}
:: {{AlertSmall|text=Your text here.}}
Spanning multiple lines will retain middle vertical alignment.
Width is automatic, and text wraps, but this template is intended for use with brief alerts or alerts used in lists. For more lengthy alerts, use [[:Template:Alert]] instead.
:: {{AlertSmall|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. Donec consequat sed quam sed malesuada. Nunc tristique a tellus quis egestas. Sed iaculis risus odio, sit amet gravida orci facilisis sed. Donec sem leo, viverra ac elit eget, posuere bibendum velit. Nunc diam est, pellentesque vitae finibus et, iaculis non lorem. Quisque ullamcorper augue non tellus vehicula dictum.}}
:: {{AlertSmall|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.}}
 
=== Within Lists ===
Use in lists is appropriate.
: '''Code:'''
<pre>
* List item 1
*: {{AlertSmall|text='Silent' indented bullet list item}}
* List item 2
</pre>
: '''Result:'''
* List item 1
*: {{AlertSmall|text='Silent' indented bullet list item}}
* List item 2
 
: '''Code:'''
<pre>
# List item 1
# List item 2<br>{{AlertSmall|text={{lorem}} }}
# List item 3
</pre>
: '''Result:'''
# List item 1
# List item 2<br>{{AlertSmall|text={{lorem}} }}
# List item 3


=== Types ===
=== Types ===
The simplest call returns defaults for the template (size=70%, solid border).
The simplest call returns defaults for the template.
: '''Code:''' <code><nowiki>{{AlertSmall|type=bug|text=Your text here.}}</nowiki></code>
: '''Code:''' <code><nowiki>{{AlertSmall|type=bug|text=Your text here.}}</nowiki></code>
: '''Result:'''
: '''Result:'''
:: {{AlertSmall|type=bug|text=Your text here.}}
:: {{AlertSmall|type=bug|text=Bug message}}
 
:: {{AlertSmall|type=warn|text=Warning message}}
=== Sizes ===
:: {{AlertSmall|type=wip|text=Under construction (WIP) message}}
Explicitly define a size (%) using either a keyword or an integer between 0 - 100.
:: {{AlertSmall|type=loot|text=Loot-specific message}}
: '''Code:''' <code><nowiki>{{AlertSmall|type=notice|size=mid|text=Your text here.}}</nowiki></code>
:: {{AlertSmall|type=mcm|text=MCM-specific message}}
: '''Code:''' <code><nowiki>{{AlertSmall|type=notice|size=23|text=Your text here.}}</nowiki></code>
:: {{AlertSmall|type=mo|text=MO-specific message}}
: '''Results:'''
:: {{AlertSmall|type=starfield|text=Starfield message}}
:: {{AlertSmall|type=notice|size=mid|text=Your text here.}}
:: {{AlertSmall|type=notice|size=23|text=Your text here.}}
 
=== Listings ===
Using it within a list!
* TextHere
* {{AlertSmall|type=notice|size=min|text=Your text here.}}
* One more item here.
* ...it just keeps going!
 
=== All Examples ===
{{AlertSmall|type=bug|size=25|text=Your text here.}}
{{AlertSmall|type=construction|size=25|text=Your text here.}}
{{AlertSmall|type=fo3|size=25|text=Your text here.}}
{{AlertSmall|type=fnv|size=25|text=Your text here.}}
{{AlertSmall|type=loot|size=25|text=Your text here.}}
{{AlertSmall|type=mcm|size=25|text=Your text here.}}
{{AlertSmall|type=mo|size=25|text=Your text here.}}
{{AlertSmall|type=notice|size=25|text=Your text here.}}
{{AlertSmall|type=warning|size=25|text=Your text here.}}


== Related Templates ==
== Related Templates ==
*[[:Template:Alert]] - A larger version of this Template to be used for a more obvious visual reference (will NOT work in lists as this version does).
*[[:Template:Alert]] - A more prominent alert that will NOT work in lists as this version does.


</noinclude>
</noinclude>

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

Forum Topic

Purpose & Usage[edit source]

This template displays a small alert on the page that can also be used within lists. For this reason, this alert has all but top outer margins set to zero, so use blank lines or breaks to separate from body text where appropriate. This template is intended for use with brief alerts or alerts used within lists. For more lengthy and prominent alerts, use Template:Alert 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
ToolsValues
  • loot - LOOT specific
  • mcm - Mod Confuguration Manager specific
  • mo - Mod Organizer specific
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: {{AlertSmall|text=Your text here.}}
Result:
Info-Logo.png
NOTE:
Your text here.

Width is automatic, and text wraps, but this template is intended for use with brief alerts or alerts used in lists. For more lengthy alerts, use Template:Alert instead.

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.

Within Lists[edit source]

Use in lists is appropriate.

Code:
* List item 1
*: {{AlertSmall|text='Silent' indented bullet list item}}
* List item 2
Result:
  • List item 1
    Info-Logo.png
    NOTE:
    'Silent' indented bullet list item
  • List item 2
Code:
# List item 1
# List item 2<br>{{AlertSmall|text={{lorem}} }}
# List item 3
Result:
  1. List item 1
  2. List item 2
    Info-Logo.png
    NOTE:
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  3. List item 3

Types[edit source]

The simplest call returns defaults for the template.

Code: {{AlertSmall|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 message

Related Templates[edit source]

  • Template:Alert - A more prominent alert that will NOT work in lists as this version does.