Difference between revisions of "Template:Box"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (!example code;)
(+type;)
Line 3: Line 3:
  
 
== Parameters ==
 
== Parameters ==
 +
 +
{{Parameter Table|name=both|parameters=
 +
{{Parameter Row|1|Small image on the left shrunk to 32×32 pixels.|[[:File:notice.svg]]}}
 +
{{Parameter Row|2|Text}}
 +
{{Parameter Row|3|Color of the box. When transparent it does hide the border.|#c8ff96}}
 +
{{Parameter Row|4|Title in bold.|None}}
 +
{{Parameter Row|type|Type of the box.|Not set}}
 +
}}
 +
 +
It is possible to add additional rows by using {{Tl|!}} in the Text parameter. One example is {{Tl|SVG available}}.
 +
 +
== Types ==
 +
With types it is possible to predefine the image and color, although both can be changed.
  
 
{| class="wikitable"
 
{| class="wikitable"
! #
+
! Type
! Optional
+
! Image
! Description
+
! Color
 +
|-
 +
| Not set
 +
| [[File:notice.svg|32px]]
 +
| {{ColorBox|#c8ff96}}
 +
|-
 +
| <tt>warning</tt>
 +
| [[File:warning.svg|32px]]
 +
| {{ColorBox|#ffdf80}}
 
|-
 
|-
{{ParameterRow|1|Small image on the left shrunk to 32×32 pixels}}
+
| <tt>editnotice</tt> or <tt>notice</tt>
{{ParameterRow|2|Text}}
+
| [[File:notice.svg|32px]]
{{ParameterRow|3|Color of the box. When transparent it does hide the border.|#c8ff96}}
+
| {{ColorBox|#f6f6f6}}
{{ParameterRow|4|Title in bold.|None}}
 
 
|}
 
|}
 
It is possible to add additional rows by using {{Tl|!}} in the Text parameter. One example is {{Tl|SVG available}}.
 
  
 
== Examples ==
 
== Examples ==
Line 27: Line 45:
 
{{Box|Warning.svg|Most of this page is entirely speculation based on in-game observation and should not be taken as absolute fact!|#FFDF80}}
 
{{Box|Warning.svg|Most of this page is entirely speculation based on in-game observation and should not be taken as absolute fact!|#FFDF80}}
  
   <nowiki>{{Box|Warning.svg|Most of this page is entirely speculation based on in-game observation and should not be taken as absolute fact!|#FFDF80}}</nowiki>
+
   <nowiki>{{Box|Warning.svg|Most of this page is entirely speculation based on in-game observation and should not be taken as absolute fact!|#ffdf80}}</nowiki>
  
 
== Additional Box templates ==
 
== Additional Box templates ==
Line 37: Line 55:
 
There exists another box template named {{Tl|mbox}} which for example {{Tl|Stub}} uses.
 
There exists another box template named {{Tl|mbox}} which for example {{Tl|Stub}} uses.
  
[[Category:Templates|Box]]</noinclude><includeonly><div style="word-wrap: normal; margin: 0em 0em 0.5em; {{#ifeq: {{{3}}}|transparent|border-style: none;|border-style: none solid solid none;}} padding: 0px; background-color: {{{3|#C8FF96}}}; font-size: 95%; border-color:#aaaaaa; border-width:1px;" class="noprint">
+
[[Category:Templates|Box]]</noinclude><includeonly><div style="word-wrap: normal; margin: 0em 0em 0.5em; {{#ifeq: {{{3}}}|transparent|border-style: none;|border-style: none solid solid none;}} padding: 0px; background-color: {{{3|{{#switch: {{{type|}}}
 +
|warning=#ffdf80
 +
|editnotice
 +
|notice=#f6f6f6
 +
|#default = #C8FF96}}}}}; font-size: 95%; border-color:#aaaaaa; border-width:1px;" class="noprint">
 
{| cellspacing="8" cellpadding="0" style="background-color: transparent;"
 
{| cellspacing="8" cellpadding="0" style="background-color: transparent;"
| style="vertical-align: middle; width: 32px;" | [[File:{{{1}}}|32px|link=]]
+
| style="vertical-align: middle; width: 32px;" | [[File:{{{1|{{#switch: {{{type|}}}
 +
|warning=warning.svg
 +
|editnotice
 +
|notice
 +
|#default=notice.svg}}}}}|32px|link=]]
 
{{#if:{{{4|}}}|
 
{{#if:{{{4|}}}|
 
! <big>{{{4}}}</big>
 
! <big>{{{4}}}</big>

Revision as of 15:11, 12 July 2013

Description

This templates create a box with an image.

Parameters

Template:Parameter Table

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 Notice.svg    
warning Warning.svg    
editnotice or notice Notice.svg    

Examples

Text
 {{Box|Kerbin18.png|Text|#FFCCCC|Title}}
This article is currently undergoing a major expansion or revamping. However, you are free to help in the construction of this page by improving it.
 {{Box|notice.svg|'''This article is currently undergoing a major expansion or revamping.''' However, you are free to help in the construction of this page by improving it.|#aaaaff|}}
Most of this page is entirely speculation based on in-game observation and should not be taken as absolute fact!
 {{Box|Warning.svg|Most of this page is entirely speculation based on in-game observation and should not be taken as absolute fact!|#ffdf80}}

Additional Box templates

There exists another box template named {{mbox}} which for example {{Stub}} uses.