Difference between revisions of "Template:MessageBox"

From Clogopedia, the Natural Selection 2 Wiki
Jump to: navigation, search
m (Test)
m (Add another example)
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
== Example ==
+
== Template ==
<nowiki>{{MessageBox|
+
This template is a general message box. It has several parameters which are detailed in the table below.
style=question|
+
 
title='''This is the title'''
+
=== Examples ===
 +
{| class="ns2table" style="width:50%"
 +
! Code
 +
! Result
 +
|-
 +
|
 +
<pre><nowiki>
 +
{{MessageBox
 +
|style=question
 +
|title=''Question:''
 
|align=left
 
|align=left
 
|color=orange
 
|color=orange
 
|This is the message
 
|This is the message
}}</nowiki>  
+
}}
Produces:
+
</nowiki></pre>  
{{MessageBox|style=question|title='''This is the title'''|align=left|color=orange|This is the message}}
+
|{{MessageBox|style=question|title=''Question:''|align=left|color=orange|This is a question}}
 
+
|-
<nowiki>{{MessageBox|
+
|
style=check|
+
<pre><nowiki>
title=''This is the title''|
+
{{MessageBox
align=center|
+
|style=check
color=green|
+
|title='''Tip:'''
This is some information}}</nowiki>
+
|align=left
Produces:
+
|color=green
{{MessageBox|style=check|title=''This is the title''|align=center|color=green|This is some information}}
+
|This is a useful tip.
 
+
}}
<nowiki>{{MessageBox|
+
</nowiki></pre>  
style=ban|
+
|{{MessageBox|style=check|title='''Tip:'''|align=left|color=green|This is a useful tip.}}
title=''This is the title''|
+
|-
align=right|
+
|<pre><nowiki>{{MessageBox
color=red|
+
|style=ban
This is some information}}</nowiki>
+
|title='''Stop!'''
Produces:
+
|align=right
{{MessageBox|style=ban|title=''This is the title''|align=center|color=red|This is some information}}
+
|color=red
 
+
|This is a warning or advisory.}}</nowiki></pre>
<nowiki>{{MessageBox|
+
|{{MessageBox|style=ban|title='''Stop!'''|align=center|color=red|This is a warning or advisory.}}
style=stats|
+
|-
title=This is the title|
+
|<pre><nowiki>{{MessageBox
align=center|
+
|style=info
color=blue|
+
|align=center
This is some information}}</nowiki>
+
|color=blue
Produces:
+
|This is some general information. This template is flexible and can support a paragraph of information if required.}}</nowiki></pre>
{{MessageBox|style=stats|title=This is the title|align=center|color=blue|This is some information}}
+
|{{MessageBox|style=info|align=center|color=blue|This is some general information. This template is flexible and can support a paragraph of information if required.}}
<pre><nowiki>{{MessageBox|style=time|title=This is the title|align=center|color=blue|This is some information}}</nowiki></pre> Produces:
+
|-
{{MessageBox|style=time|title=This is the title|align=center|color=blue|This is some information}}
+
|<pre><nowiki>{{MessageBox
<pre><nowiki>{{MessageBox|style=steam|title=This is the title|align=center|color=blue|This is some information}}</nowiki></pre> Produces:
+
|style=time
{{MessageBox|style=steam|title=This is the title|align=center|color=blue|This is some information}}
+
|title=Information:
</noinclude>
+
|align=right
<includeonly>
+
|color=yellow
{{#vardefine:style|{{#switch: {{{style|}}} | question = fa fa-question-circle | warning = fas fa-exclamation-circle | check = fas fa-check-circle | ban = fas fa-ban | user = fas fa-user-circle | time = fas fa-clock | crosshair = fas fa-crosshairs | steam = fab fa-steam | #default = fas fa-circle }} }}{{#vardefine:color|{{#switch: {{{color|}}} | red = #ad0f0f | yellow = #e8e814 | orange = #ff9B00 | green = #0fad0f | blue = #0f4ead | #default = #fff }} }}
+
|This is some general information. This template is flexible and can support a paragraph of information if required.}}</nowiki></pre>
{| class="ns2table" style="text-align:{{#if:{{{align|}}}|{{{align}}}|left}}; height:70px; border-spacing: 2px; border: 1px solid darkgray;"
+
|{{MessageBox|style=time|title=Information:|align=right|color=yellow|This is some general information. This template is flexible and can support a paragraph of information if required.}}
 +
|-
 +
|<pre><nowiki>{{MessageBox
 +
|style=steam
 +
|align=left
 +
|color=blue
 +
|This is some information}}</nowiki></pre>
 +
|{{MessageBox|style=steam|align=left|color=blue|This is a link to [http://www.steampowered.com Steam].}}
 +
|-
 +
|<pre><nowiki>{{MessageBox
 +
|style=warning
 +
|title=Warning!
 +
|color=red
 +
|This a warning.}}</nowiki></pre>
 +
|{{MessageBox|style=warning|title=Warning!|color=red|This is a warning.}}
 +
|-
 +
|<pre><nowiki>{{MessageBox
 +
|style=crosshair
 +
|align=left
 +
|color=red
 +
|This is some information}}</nowiki></pre>
 +
|{{MessageBox|style=crosshair|align=left|color=red|This is some information}}
 +
|}
 +
</noinclude><includeonly>
 +
{{#vardefine:style|{{#switch: {{{style|}}} | info = fas fa-info-circle | question = fa fa-question-circle | warning = fas fa-exclamation-circle | check = fas fa-check-circle | ban = fas fa-ban | user = fas fa-user-circle | time = fas fa-clock | crosshair = fas fa-crosshairs | steam = fab fa-steam | #default = fas fa-circle }} }}{{#vardefine:color|{{#switch: {{{color|}}} | red = #ad0f0f | yellow = #eed202 | orange = #ff9B00 | green = #0fad0f | blue = #0f4ead | #default = #fff }} }}{| class="ns2table" style="text-align:{{#if:{{{align|}}}|{{{align}}}|left}}; height:70px; border-spacing: 2px; border: 1px solid darkgray;"
 
| <span class="fa-3x fa-layers fa-fw"><span style="color:{{#var:color}}"><i class="fas fa-circle" style="color:#fff"></i><i class="{{#var:style}}" aria-hidden="true"></i></span></span>
 
| <span class="fa-3x fa-layers fa-fw"><span style="color:{{#var:color}}"><i class="fas fa-circle" style="color:#fff"></i><i class="{{#var:style}}" aria-hidden="true"></i></span></span>
| {{#if:{{{title|}}}|{{{title}}}:|'''Message:'''}} {{{1|}}}
+
| {{#if:{{{title|}}} | {{{title}}} }} {{{1|}}}
 
|}</includeonly>
 
|}</includeonly>

Latest revision as of 22:57, 16 May 2019

Template

This template is a general message box. It has several parameters which are detailed in the table below.

Examples

Code Result
{{MessageBox
|style=question
|title=''Question:''
|align=left
|color=orange
|This is the message
}}
Question: This is a question
{{MessageBox
|style=check
|title='''Tip:'''
|align=left
|color=green
|This is a useful tip.
}}
Tip: This is a useful tip.
{{MessageBox
|style=ban
|title='''Stop!'''
|align=right
|color=red
|This is a warning or advisory.}}
Stop! This is a warning or advisory.
{{MessageBox
|style=info
|align=center
|color=blue
|This is some general information. This template is flexible and can support a paragraph of information if required.}}
This is some general information. This template is flexible and can support a paragraph of information if required.
{{MessageBox
|style=time
|title=Information:
|align=right
|color=yellow
|This is some general information. This template is flexible and can support a paragraph of information if required.}}
Information: This is some general information. This template is flexible and can support a paragraph of information if required.
{{MessageBox
|style=steam
|align=left
|color=blue
|This is some information}}
This is a link to Steam.
{{MessageBox
|style=warning
|title=Warning!
|color=red
|This a warning.}}
Warning! This is a warning.
{{MessageBox
|style=crosshair
|align=left
|color=red
|This is some information}}
This is some information