Messagebox – Template
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Fix wiki paragraph bug) |
Lou Montana (talk | contribs) (Fix the line return issue for lists - nice trick, thanks https://www.mediawiki.org/wiki/Extension:ParserFunctions/String_functions##replace (nowiki/ twice instead of nowiki /nowiki)) |
||
Line 1: | Line 1: | ||
<includeonly><div class="biki-messagebox" style="background-color:{{{3|#025D00}}}"><!-- | <includeonly><div class="biki-messagebox" style="background-color:{{{3|#025D00}}}"><!-- | ||
--><div>{{{2|i}}}</div><!-- | --><div>{{{2|i}}}</div><!-- | ||
--><div> | --><div>{{#if:{{Trim|{{{1|}}}}}|{{Trim|{{#replace:{{#replace:{{{1|}}}|<nowiki/> | ||
{{#if:{{Trim|{{{1|}}}}}|{{Trim|{{{1|}}}}}|-Text not defined-}} | |||
</div><!-- | <nowiki/>|<br>}}|<nowiki/> | ||
<nowiki/>|<nowiki/> <nowiki/>}}}}|-Text not defined-}}</div><!-- | |||
--></div></includeonly><noinclude>Displays a standardised message box. | --></div></includeonly><noinclude>Displays a standardised message box. | ||
Base of messageboxes, used by <span class="plainlinks">[{{SERVER}}/wiki?title=Special%3AWhatLinksHere&target=Template%3AMessagebox&namespace=10 many other templates]</span>. | Base of messageboxes, used by <span class="plainlinks">[{{SERVER}}/wiki?title=Special%3AWhatLinksHere&target=Template%3AMessagebox&namespace=10 many other templates]</span>. | ||
Line 51: | Line 52: | ||
General Kenobi! | General Kenobi! | ||
}} | }} | ||
|- | |||
| <pre> | |||
{{Feature|informative|Before}} | |||
* First | |||
: {{Feature|informative|indented}} | |||
: {{Feature|informative|indented | |||
two lines}} | |||
* {{Feature|informative|Second, | |||
line return, | |||
double line return}} | |||
* {{Feature|informative| | |||
Third, | |||
line return, | |||
double line return}} | |||
* Last | |||
{{Feature|informative|After}} | |||
</pre> | |||
| | |||
{{Feature|informative|Before}} | |||
* First | |||
: {{Feature|informative|indented}} | |||
: {{Feature|informative|indented | |||
two lines}} | |||
* {{Feature|informative|Second, | |||
line return, | |||
double line return}} | |||
* {{Feature|informative| | |||
Third, | |||
line return, | |||
double line return}} | |||
* Last | |||
{{Feature|informative|After}} | |||
|- | |- | ||
| <nowiki>{{Messagebox|Yep|Unreadable!|#EEE}}</nowiki> | | <nowiki>{{Messagebox|Yep|Unreadable!|#EEE}}</nowiki> | ||
Line 78: | Line 115: | ||
<div class="biki-messagebox" style="background-color:{{{3|#025D00}}}"><!-- | <div class="biki-messagebox" style="background-color:{{{3|#025D00}}}"><!-- | ||
--><div>{{{2|i}}}</div><!-- | --><div>{{{2|i}}}</div><!-- | ||
--><div>{{#if:{{Trim|{{{1|}}}}}|{{Trim|{{{1|}}}}}|-Text not defined-}}</div><!-- | --><div>{{#if:{{Trim|{{{1|}}}}}|{{Trim|{{#replace:{{#replace:{{{1|}}}|<nowiki/> | ||
<nowiki/>|<br>}}|<nowiki/> | |||
<nowiki/>|<nowiki/> <nowiki/>}}}}|-Text not defined-}}</div><!-- | |||
--></div> | --></div> | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 11:47, 4 December 2023
Displays a standardised message box. Base of messageboxes, used by many other templates.
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 {{hl|[[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)
Code | Result |
---|---|
{{Messagebox}} | |
{{Messagebox|Hello there!}} | |
{{Messagebox|Hello there!|✔}} | |
{{Messagebox|Hello there!|✔|orange}} | |
{{Messagebox|Hello there!|✔|#CDF}} | |
{{Messagebox|Text: Hello there! General Kenobi! }} |
|
{{Messagebox|Text: Hello there! General Kenobi! }} |
|
{{Feature|informative|Before}} * First : {{Feature|informative|indented}} : {{Feature|informative|indented two lines}} * {{Feature|informative|Second, line return, double line return}} * {{Feature|informative| Third, line return, double line return}} * Last {{Feature|informative|After}} |
|
{{Messagebox|Yep|Unreadable!|#EEE}} | |
{{Messagebox|{{arma3}} logo|[[File:Arma 3_logo_black.png|300px|center]]|#888}} | |
{{Messagebox|[[File:Arma 3_logo_black.png|300px|center]]|{{arma3}} logo|#333}} | |
{{Messagebox|{{ofp}}<br>{{arma1}}<br>{{arma2}}<br>{{arma3}}|A|#333}} | |
{{Messagebox|{{arma3}}|a<br>b<br>c<br>d|#333}} | |
{{Messagebox|One line text|{{arma3}}|#FDA}} | |
{{Messagebox|{{Wiki|lorem}}|{{arma3}}|#FDA}} |
Source
<div class="biki-messagebox" style="background-color:{{{3|#025D00}}}"><!--
--><div>{{{2|i}}}</div><!--
--><div>{{#if:{{Trim|{{{1|}}}}}|{{Trim|{{#replace:{{#replace:{{{1|}}}|<nowiki/>
<nowiki/>|<br>}}|<nowiki/>
<nowiki/>|<nowiki/> <nowiki/>}}}}|-Text not defined-}}</div><!--
--></div>