Difference between revisions of "Template:Box"
From Kerbal Space Program Wiki
m (!example code;) |
|||
(12 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | < | + | <includeonly>{| class="ambox noprint" style="border-left-color: {{{3|#{{#switch: {{{type|}}} |
− | + | |error=b22222 | |
− | + | |warning=f4c430 | |
− | + | |note | |
− | + | |notice=bbbbaa | |
− | {| class=" | + | |info |
− | + | |disambig | |
− | + | |#default=1e90ff}}}}}" | |
− | + | | class="mbox-image" | {{#if: {{{1|}}}|{{#if: {{{2|}}}|[[File:{{{1|}}}|40x40px|alt=|link=]]|[[File:{{#switch: {{{type|}}} | |
− | + | |error=Ambox warning pn.svg | |
− | + | |warning=warning.svg | |
− | + | |disambig=Disambig-dark.svg | |
− | {{ | + | |note |
− | {{ | + | |notice |
− | + | |info | |
− | + | |#default=notice.svg}}|40x40px|alt=|link=]]}}}} | |
− | + | | class="mbox-text" | {{#if: {{{2|}}}|{{{2}}}|{{{1}}}}} | |
− | + | |}</includeonly><noinclude> | |
− | = | + | {{Documentation}} |
− | + | </noinclude> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | [[ | ||
− | |||
− | | | ||
− | {{#if:{{{ | ||
− | |||
− | }} | ||
− | |||
− | |} | ||
− | </ |
Latest revision as of 23:52, 4 February 2020
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 | ||
error | ||
warning | ||
note or notice | ||
disambig |
Examples
{{Box|Kerbin18.png|Box with a custom image and color, overriding the <tt>type</tt>.|#00bb00|type=error}}
{{Box|Kerbin18.png|Box with a custom image and color, no <tt>type</tt> set.|#00bb00}}
{{Box|Kerbin18.png|Box with a custom image, no color set.}}
{{Box|type=warning|Box with <tt>type</tt> set to <tt>warning</tt>.}}
{{Box|Box with default settings.}}
Additional Box templates
- {{About}}
- {{Blocked}} (and {{Spammer}})
- {{Data template used}}
- {{Delete}}
- {{Disambiguation}}
- {{Incomplete Translation}}
- {{LowRes}}
- {{Merge}}
- {{Move}}
- {{NoThumbnailsPlease}}
- {{Outdated}}
- {{Part config}}
- {{Protect}}
- {{Spoiler}}
- {{Stub}}
- {{SVG available}}
- {{Talkarchive}}
- {{WrongLanguageCode}} (and {{HasWrongLanguageCode}})
The above documentation is transcluded from Template:Box/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |