Difference between revisions of "Template:Box"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Upgrade booland to parser function, move doc)
m (Undo revision 97142 by ArnePeirs (talk))
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
|error=b22222
 
|error=b22222
 
|warning=f4c430
 
|warning=f4c430
|editnotice
+
|note
 
|notice=bbbbaa
 
|notice=bbbbaa
|note
+
|info
 
|disambig
 
|disambig
 
|#default=1e90ff}}}}}"
 
|#default=1e90ff}}}}}"
Line 11: Line 11:
 
|warning=warning.svg
 
|warning=warning.svg
 
|disambig=Disambig-dark.svg
 
|disambig=Disambig-dark.svg
|editnotice
+
|note
 
|notice
 
|notice
|note
+
|info
 
|#default=notice.svg}}|40x40px|alt=|link=]]}}}}
 
|#default=notice.svg}}|40x40px|alt=|link=]]}}}}
 
| class="mbox-text" | {{#if: {{{2|}}}|{{{2}}}|{{{1}}}}}
 
| class="mbox-text" | {{#if: {{{2|}}}|{{{2}}}|{{{1}}}}}
|}</includeonly><noinclude>{{Documentation}}</noinclude>
+
|}</includeonly><noinclude>
 +
{{Documentation}}
 +
</noinclude>

Latest revision as of 23:52, 4 February 2020

Documentation icon Template documentation[view] [edit] [history] [purge]Pages that link to Template:Box

Usage

Recommended usage: {{Box|''Contents''}}

Parameters

#/Name Optional Description Default
1 Yes Small image on the left shrunk to 40×40 pixels. File:notice.svg
2 No Text, if this parameter isn't set, uses the first parameter as text.
3 Yes Color of the box. When transparent it does hide the border. #1e90ff    
type Yes Type of the box. Not set

It is possible to add additional rows by using {{!}} in the Text parameter. One example is {{SVG available}}.

Types

With types it is possible to predefine the image and color, although both can be changed.

Type Image Color
Not set or info Notice.svg    
error Ambox warning pn.svg    
warning Warning.svg    
note or notice Notice.svg    
disambig Disambig-dark.svg    

Examples

Box with a custom image and color, overriding the type.
 {{Box|Kerbin18.png|Box with a custom image and color, overriding the <tt>type</tt>.|#00bb00|type=error}}
Box with a custom image and color, no type set.
 {{Box|Kerbin18.png|Box with a custom image and color, no <tt>type</tt> set.|#00bb00}}
Box with a custom image, no color set.
 {{Box|Kerbin18.png|Box with a custom image, no color set.}}
Box with type set to warning.
 {{Box|type=warning|Box with <tt>type</tt> set to <tt>warning</tt>.}}
Box with default settings.
 {{Box|Box with default settings.}}

Additional Box templates