Messagebox – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix R3vo's OCD :D)
m (Add comments (so template can be used in listts) and dimension limits, add examples)
Line 1: Line 1:
<includeonly><div style="background-color: {{{3|#025D00}}}; color: #FFF; display: flex; align-items: center; margin: 0.5em 0">
<includeonly><div style="background-color: {{{3|#025D00}}}; color: #FFF; display: flex; align-items: center; margin: 0.5em 0"><!--
<div style="min-width: 28px; font-size: 28px; height: 100%; margin: -2px 8px; text-align: center;">{{{2|-}}}</div>
--><div style="min-width: 28px; max-width: 60px; min-height: 28px; max-height: 48px; font-size: 28px; margin: -2px 8px; overflow: hidden; text-align: center;">{{{2|i}}}</div><!--
<div style="background-color: #FFF; color: #333; flex-grow: 1; height: 100%; margin: 0.25em; padding: 0.5em;">{{{1|-Text not defined-}}}</div>
--><div style="background-color: #FFF; color: #333; flex-grow: 1; height: 100%; margin: 0.25em; padding: 0.5em;">{{{1|-Text not defined-}}}</div><!--
</div></includeonly><noinclude>Displays a standardised message box.
--></div></includeonly><noinclude>Displays a standardised message box.


== Usage ==
== Usage ==
<nowiki>{{Messagebox|</nowiki>'''''message'''''|'''''icon'''''|'''''colour'''''}}
<nowiki>{{Messagebox|</nowiki>'''''message'''''|'''''icon'''''|'''''colour'''''}}
* message: the message to display
* message: the message to display
* icon: (Optional, default "M") symbol to the left, a letter (written in white) or an image (format <nowiki>[[File]]</nowiki>)
* icon: (Optional, default "i") symbol to the left, a letter (written in white) or an image (format <nowiki>[[File]]</nowiki>)
* colour: (Optional, default #025D00) box HTML colour, can be one of:
* colour: (Optional, default #025D00) box HTML colour, can be one of:
** HTML colour name - ''red'', ''darkgrey'', etc.
** HTML colour name - ''red'', ''darkgrey'', etc.
Line 35: Line 35:
| <nowiki>{{Messagebox|Hello there!|✔|#CDF}}</nowiki>
| <nowiki>{{Messagebox|Hello there!|✔|#CDF}}</nowiki>
| {{Messagebox|Hello there!|✔|#CDF}}
| {{Messagebox|Hello there!|✔|#CDF}}
|-
| <nowiki>{{Messagebox|Yep|Unreadable!|#EEE}}</nowiki>
| {{Messagebox|Yep|Unreadable!|#EEE}}
|-
| <nowiki>{{Messagebox|Arma 3 logo|[[File:Arma 3_logo_black.png|300px|center]]|#333}}</nowiki>
| {{Messagebox|Arma 3 logo|[[File:Arma 3_logo_black.png|300px|center]]|#333}}
|-
| <nowiki>{{Messagebox|[[File:Arma 3_logo_black.png|300px|center]]|Arma 3 logo|#333}}</nowiki>
| {{Messagebox|[[File:Arma 3_logo_black.png|300px|center]]|Arma 3 logo|#333}}
|-
| <nowiki>{{Messagebox|{{ofp}}<br>{{arma}}<br>{{arma2}}<br>{{arma3}}|A|#333}}</nowiki>
| {{Messagebox|{{ofp}}<br>{{arma}}<br>{{arma2}}<br>{{arma3}}|A|#333}}
|-
| <nowiki>{{Messagebox|{{arma3}}|a<br>b<br>c<br>d|#333}}</nowiki>
| {{Messagebox|{{arma3}}|a<br>b<br>c<br>d|#333}}
|}
|}


== Source ==
== Source ==
<syntaxhighlight lang="html">
<syntaxhighlight lang="html">
<div style="background-color: COLOUR; color: #FFF; display: flex; align-items: center; margin: 0.5em 0">
<div style="background-color: {{{3|#025D00}}}; color: #FFF; display: flex; align-items: center; margin: 0.5em 0"><!--
<div style="min-width: 28px; font-size: 28px; height: 100%; margin: -2px 8px;">ICON</div>
--><div style="min-width: 28px; max-width: 60px; min-height: 28px; max-height: 48px; font-size: 28px; margin: -2px 8px; overflow: hidden; text-align: center;">{{{2|i}}}</div><!--
<div style="background-color: #FFF; color: #333; flex-grow: 1; height: 100%; margin: 0.25em; padding: 0.5em;">MESSAGE</div>
--><div style="background-color: #FFF; color: #333; flex-grow: 1; height: 100%; margin: 0.25em; padding: 0.5em;">{{{1|-Text not defined-}}}</div><!--
</div>
--></div>
</syntaxhighlight>
</syntaxhighlight>


[[Category:Templates|{{uc:messagebox}}]]
[[Category:Templates|{{uc:messagebox}}]]
</noinclude>
</noinclude>

Revision as of 14:01, 12 September 2019

Displays a standardised message box.

Usage

{{Messagebox|message|icon|colour}}

  • message: the message to display
  • icon: (Optional, default "i") symbol to the left, a letter (written in white) or an image (format [[File]])
  • colour: (Optional, default #025D00) box HTML colour, can be one of:
    • HTML colour name - red, darkgrey, etc.
    • HTML colour format - #RGB or #RRGGBB
    • rgb format - rgb(255, 0, 0)
    • rgba format - rgba(255, 0, 0, 0.5)
    • hsl format - hsl(120, 100%, 50%)
    • hsla format - hsla(120, 60%, 70%, 0.3)
Examples
Code Result
{{Messagebox}}
i
-Text not defined-
{{Messagebox|Hello there!}}
i
Hello there!
{{Messagebox|Hello there!|✔}}
Hello there!
{{Messagebox|Hello there!|✔|orange}}
Hello there!
{{Messagebox|Hello there!|✔|#CDF}}
Hello there!
{{Messagebox|Yep|Unreadable!|#EEE}}
Unreadable!
Yep
{{Messagebox|Arma 3 logo|[[File:Arma 3_logo_black.png|300px|center]]|#333}}
Arma 3 logo black.png
Arma 3 logo
{{Messagebox|[[File:Arma 3_logo_black.png|300px|center]]|Arma 3 logo|#333}}
Arma 3 logo
Arma 3 logo black.png
{{Messagebox|{{ofp}}<br>{{arma}}<br>{{arma2}}<br>{{arma3}}|A|#333}}
A
Operation Flashpoint
Arma
Arma 2
Arma 3
{{Messagebox|{{arma3}}|a<br>b<br>c<br>d|#333}}
a
b
c
d
Arma 3

Source

<div style="background-color: {{{3|#025D00}}}; color: #FFF; display: flex; align-items: center; margin: 0.5em 0"><!--
--><div style="min-width: 28px; max-width: 60px; min-height: 28px; max-height: 48px; font-size: 28px; margin: -2px 8px; overflow: hidden; text-align: center;">{{{2|i}}}</div><!--
--><div style="background-color: #FFF; color: #333; flex-grow: 1; height: 100%; margin: 0.25em; padding: 0.5em;">{{{1|-Text not defined-}}}</div><!--
--></div>