Template:WarningBox: Difference between revisions
DrinkyBird (talk | contribs) No edit summary Tag: Source edit |
DrinkyBird (talk | contribs) No edit summary Tag: Source edit |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
<div style="float: right">__TOC__</div> | |||
== Template data == | |||
<templatedata> | <templatedata> | ||
{ | { | ||
Line 5: | Line 8: | ||
"border": { | "border": { | ||
"label": "Border colour", | "label": "Border colour", | ||
"description": " | "description": "Hex colour value for the border", | ||
"type": "line", | "type": "line", | ||
"default": " | "default": "000000" | ||
}, | }, | ||
"background": { | "background": { | ||
"label": "Background colour", | "label": "Background colour", | ||
"description": " | "description": "Hex colour value for the background", | ||
"type": "line", | "type": "line", | ||
"default": " | "default": "FFFFFF" | ||
}, | }, | ||
"color": { | "color": { | ||
"label": "Text colour", | "label": "Text colour", | ||
"description": " | "description": "Hex colour value for the text", | ||
"type": "line", | "type": "line", | ||
"default": " | "default": "000000" | ||
}, | }, | ||
"image": { | "image": { | ||
Line 32: | Line 35: | ||
"type": "content", | "type": "content", | ||
"required": true | "required": true | ||
}, | |||
"imagesize": { | |||
"label": "Image size", | |||
"description": "Pixel size of the image - this affects both width and height", | |||
"type": "number", | |||
"default": "46" | |||
}, | |||
"imagelink": { | |||
"label": "Image link", | |||
"description": "Link the user will be sent to upon clicking the image", | |||
"type": "url" | |||
}, | |||
"wikitable": { | |||
"label": "Wikitable", | |||
"description": "Use the wikitable class for the warning box. Disables all colour parameters.", | |||
"type": "boolean", | |||
"default": "false" | |||
}, | |||
"textalign": { | |||
"label": "Text alignment", | |||
"description": "Text alignment of the content. One of: left, center, right", | |||
"type": "line", | |||
"default": "center" | |||
} | } | ||
}, | }, | ||
"format": "block" | "format": "block", | ||
"description": "A highly customisable warning box", | |||
"paramOrder": [ | |||
"content", | |||
"image", | |||
"imagelink", | |||
"imagesize", | |||
"wikitable", | |||
"color", | |||
"background", | |||
"border", | |||
"textalign" | |||
] | |||
} | } | ||
</templatedata> | </templatedata> | ||
</noinclude>{| align=center border=0 cellpadding=4 cellspacing=4 style="border: solid 1px {{#if:{{{border|}}}|{{{border}}}| | |||
== Examples == | |||
<ol> | |||
<li> | |||
<pre><nowiki>{{WarningBox | |||
| content = Test | |||
}}</nowiki></pre> | |||
becomes | |||
{{WarningBox | |||
| content = Test | |||
}} | |||
</li> | |||
<li> | |||
<pre><nowiki>{{WarningBox | |||
| image = Unkna0.png | |||
| content = Test | |||
| background = EFEFEF | |||
}}</nowiki></pre> | |||
becomes | |||
{{WarningBox | |||
| image = Unkna0.png | |||
| content = Test | |||
| background = EFEFEF | |||
}} | |||
</li> | |||
<li> | |||
<pre><nowiki>{{WarningBox | |||
| image = Za exe2 logo cropped.png | |||
| content = <- Click that image to view the page [[Zandronum]] | |||
| imagelink = Zandronum | |||
}}</nowiki></pre> | |||
becomes | |||
{{WarningBox | |||
| image = Za exe2 logo cropped.png | |||
| content = <- Click that image to view the page [[Zandronum]] | |||
| imagelink = Zandronum | |||
}} | |||
</li> | |||
<li> | |||
<pre><nowiki>{{WarningBox | |||
| image = Za exe2 logo cropped.png | |||
| content = This article documents a [[Zandronum]]-specific [[ACS]] feature which may not be supported by [[doomwiki:ZDoom|ZDoom]] and its other child ports. | |||
| background = F0FFD1 | |||
| border = 41443A | |||
| color = 000000 | |||
}}</nowiki></pre> | |||
becomes | |||
{{WarningBox | |||
| image = Za exe2 logo cropped.png | |||
| content = This article documents a [[Zandronum]]-specific [[ACS]] feature which may not be supported by [[doomwiki:ZDoom|ZDoom]] and its other child ports. | |||
| background = F0FFD1 | |||
| border = 41443A | |||
| color = 000000 | |||
}} | |||
</li> | |||
<li> | |||
<pre><nowiki>{{WarningBox | |||
| content = This article is a stub. | |||
| wikitable = true | |||
| textalign = left | |||
}}</nowiki></pre> | |||
becomes | |||
{{WarningBox | |||
| content = This article is a stub. | |||
| wikitable = true | |||
| textalign = left | |||
}} | |||
</li> | |||
</ol> | |||
</noinclude><includeonly>{| align="center" border=0 cellpadding=4 cellspacing=4 {{#ifeq: {{{wikitable|}}} | true | class="wikitable" style=" | style="border: solid 1px #{{#if: {{{border|}}} | {{{border}}} | 000000}}; background-color: #{{#if: {{{background|}}} | {{{background}}} | FFFFFF}}; color: #{{#if: {{{color|}}} | {{{color}}} | 000000}}; }} padding: 0.4em 1em; width: 75%; margin: 1em auto; text-align: {{#if: {{{textalign|}}} | {{{textalign}}} | center}}; border-radius: 3px" | |||
|- | |- | ||
| {{#if: {{{image|}}}|[[{{{image}}}| | | style="border:none; width: {{#if: {{{imagesize|}}} | {{{imagesize}}} | 46}}px; {{#if: {{{image|}}} | | display:none}}" | {{#if: {{{image|}}} | [[File:{{{image}}}|{{#if: {{{imagesize|}}} | {{{imagesize}}} | 46}}x{{#if: {{{imagesize|}}} | {{{imagesize}}} | 46}}px|link={{{imagelink|}}}]] }} | ||
| {{{content}}} | | style="border: none" | {{{content}}} | ||
|} | |}</includeonly> |
Latest revision as of 04:20, 3 January 2023
Template data
A highly customisable warning box
Parameter | Description | Type | Status | |
---|---|---|---|---|
Content | content | Wikitext content of the warning box | Content | required |
Image | image | Image file name | File | suggested |
Image link | imagelink | Link the user will be sent to upon clicking the image | URL | optional |
Image size | imagesize | Pixel size of the image - this affects both width and height
| Number | optional |
Wikitable | wikitable | Use the wikitable class for the warning box. Disables all colour parameters.
| Boolean | optional |
Text colour | color | Hex colour value for the text
| Line | optional |
Background colour | background | Hex colour value for the background
| Line | optional |
Border colour | border | Hex colour value for the border
| Line | optional |
Text alignment | textalign | Text alignment of the content. One of: left, center, right
| Line | optional |
Examples
-
{{WarningBox | content = Test }}
becomes
Test -
{{WarningBox | image = Unkna0.png | content = Test | background = EFEFEF }}
becomes
Test -
{{WarningBox | image = Za exe2 logo cropped.png | content = <- Click that image to view the page [[Zandronum]] | imagelink = Zandronum }}
becomes
<- Click that image to view the page Zandronum -
{{WarningBox | image = Za exe2 logo cropped.png | content = This article documents a [[Zandronum]]-specific [[ACS]] feature which may not be supported by [[doomwiki:ZDoom|ZDoom]] and its other child ports. | background = F0FFD1 | border = 41443A | color = 000000 }}
becomes
This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports. -
{{WarningBox | content = This article is a stub. | wikitable = true | textalign = left }}
becomes
This article is a stub.