Difference between revisions of "Template:Box"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (+one example;)
m (*renamed Parameter Table to Parameter table;)
(9 intermediate revisions by 2 users not shown)
Line 3: Line 3:
  
 
== Parameters ==
 
== Parameters ==
 +
 +
{{Parameter table|name=both|parameters=
 +
{{Parameter row|1|Small image on the left shrunk to 40×40 pixels.|[[:File:notice.svg]]}}
 +
{{Parameter row|2|Text, if this parameter isn't set, uses the first parameter as text.}}
 +
{{Parameter row|3|Color of the box. When transparent it does hide the border.|<tt>#1e90ff</tt> {{ColorBox|#1e90ff}}}}
 +
{{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 or <tt>info</tt>
 +
| [[File:notice.svg|40px]]
 +
| {{ColorBox|#1e90ff}}
 +
|-
 +
| <tt>error</tt>
 +
| [[File:Ambox warning pn.svg|40px]]
 +
| {{ColorBox|#b22222}}
 +
|-
 +
| <tt>warning</tt>
 +
| [[File:warning.svg|40px]]
 +
| {{ColorBox|#f4c430}}
 +
|-
 +
| <tt>editnotice</tt> or <tt>notice</tt>
 +
| [[File:notice.svg|40px]]
 +
| {{ColorBox|#bba}}
 
|-
 
|-
{{ParameterRow|1|Small image on the left shrunk to 32×32 pixels}}
+
| <tt>disambig</tt>
{{ParameterRow|2|Text}}
+
| [[File:Disambig-dark.svg|40px]]
{{ParameterRow|3|Color of the box. When transparent it does hide the border.|#c8ff96}}
+
| {{ColorBox|#1e90ff}}
{{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 ==
{{Box|Kerbin18.png|Text|#FFCCCC|Title}}
+
{{Box|Kerbin18.png|Text|#b22222|Title}}
  
   <nowiki>{{Box|Kerbin18.png|Text|#FFCCCC|Title}}</nowiki>
+
   <nowiki>{{Box|Kerbin18.png|Text|#b22222|Title}}</nowiki>
  
{{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|}}
+
{{Box|2='''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.}}
  
   <nowiki>{{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|}}</nowiki>
+
   <nowiki>{{Box|2='''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.}}</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}}
+
{{Box|type=warning|Most of this page is entirely speculation based on in-game observation and should not be taken as absolute fact!}}
  
<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|type=warning|Most of this page is entirely speculation based on in-game observation and should not be taken as absolute fact!}}</nowiki>
  
 
== Additional Box templates ==
 
== Additional Box templates ==
* {{Tl|SVG available}}
+
* {{Tl|About}}
 +
* {{Tl|Blocked}} (and {{Tl|Spammer}})
 +
* {{Tl|Data template used}}
 
* {{Tl|Delete}}
 
* {{Tl|Delete}}
 +
* {{Tl|Disambiguation}}
 +
* {{Tl|Incomplete Translation}}
 +
* {{Tl|LowRes}}
 +
* {{Tl|Merge}}
 +
* {{Tl|Move}}
 +
* {{Tl|NoThumbnailsPlease}}
 +
* {{Tl|Outdated}}
 +
* {{Tl|Part config}}
 
* {{Tl|Protect}}
 
* {{Tl|Protect}}
 
* {{Tl|Spoiler}}
 
* {{Tl|Spoiler}}
 +
* {{Tl|Stub}}
 +
* {{Tl|SVG available}}
 +
* {{Tl|Talkarchive}}
 +
* {{Tl|WrongLanguageCode}} (and {{Tl|HasWrongLanguageCode}})
  
There exists another box template named {{Tl|mbox}} which for example {{Tl|Stub}} uses.
+
[[Category:Templates]]</noinclude><includeonly>{| class="ambox noprint" style="border-left-color: {{{3|#{{#switch: {{{type|}}}
 
+
|error=b22222
[[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">
+
|warning=f4c430
{| cellspacing="8" cellpadding="0" style="background-color: transparent;"
+
|editnotice
| style="vertical-align: middle; width: 32px;" | [[File:{{{1}}}|32px|link=]]
+
|notice=bba
{{#if:{{{4|}}}|
+
|note
! <big>{{{4}}}</big>
+
|disambig
}}
+
|#default=1e90ff}}}}}"
| style="vertical-align: middle; width: 100%; text-align: left;" | {{{2}}}
+
| class="mbox-image" | {{#if: {{Booland|{{{1|}}}|{{{2|}}}}}|[[File:{{{1|}}}|40x40px|alt=|link=]]|[[File:{{#switch: {{{type|}}}
|}
+
|error=Ambox warning pn.svg
</div></includeonly>
+
|warning=warning.svg
 +
|disambig=Disambig-dark.svg
 +
|editnotice
 +
|notice
 +
|note
 +
|#default=notice.svg}}|40x40px|alt=|link=]]}}
 +
| class="mbox-text" | {{#if: {{{2|}}}|{{{2}}}|{{{1}}}}}
 +
|}</includeonly>

Revision as of 12:01, 19 December 2014

Description

This templates create a box with an image.

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    
editnotice or notice Notice.svg    
disambig Disambig-dark.svg    

Examples

Text
 {{Box|Kerbin18.png|Text|#b22222|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|2='''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.}}
Most of this page is entirely speculation based on in-game observation and should not be taken as absolute fact!
 {{Box|type=warning|Most of this page is entirely speculation based on in-game observation and should not be taken as absolute fact!}}

Additional Box templates