Template:Messagebox: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(Moved doc to doc. Increased readability. Removed unused parameter {{{padding}}}. Added {{{style}}} parameter.)
Line 1: Line 1:
<noinclude>{{lang|Template:Messagebox}}</noinclude>
{{lang|Template:Messagebox}}
<table class="metadata plainlinks mbox" style="border: 1px solid {{{bdcolor2|#525252}}}; {{{borderstyle|border-left: 10px solid}}} {{{bdcolor|#537AA8}}}; margin: {{{margin|0 10%;}}}; padding: {{{padding|}}}; font-style: {{{txtstyle|normal}}}; background-color: {{{bgcolor|#28374b}}}; {{#if: {{{txtcolor|}}} | color: {{{txtcolor|}}} }}">
<onlyinclude><includeonly><!--
<tr>
-->{| class="metadata plainlinks mbox" style="<!--
<td class="mbox-image">
  -->border: 1px solid {{{bdcolor2|#525252}}};<!--
{{#ifeq: {{{image}}} | None | | <div style="margin: 0 .5em;">{{{image|[[File:Info.png|40px|link=]]}}}</div> }}
  -->{{{borderstyle|border-left: 10px solid}}} {{{bdcolor|#537AA8}}};<!--
</td>
  -->margin: {{{margin|0 10%}}};<!--
<td class="mbox-text" style="width: 100%">
  -->font-style: {{{txtstyle|normal}}};<!--
{{{text}}}
  -->background-color: {{{bgcolor|#28374b}}};<!--
{{#if: {{{small|}}} | <br /><small>{{{small}}}</small> }}
  -->{{#if: {{{txtcolor|}}} | color: {{{txtcolor}}}; }}<!--
</td>
  -->{{{style|}}};<!--
</tr>
-->"
</table><noinclude>
| class="mbox-image"| {{#ifeq: {{{image}}} | None | | <div style="margin: 0 .5em;">{{{image|[[File:Info.png|40px|link=]]}}}</div> }}
{{Tsh|Mbox}}
| class="mbox-text" style="width: 100%"| {{{text}}} {{#if: {{{small|}}} | <br /><small>{{{small}}}</small> }}
==Documentation ==
|}</includeonly></onlyinclude>
A simple messagebox template.
{{documentation}}
 
All parameters except text are optional, as they will be defined by default.
 
===List of Parameters ===
text = Write your text
 
small = Write small text
 
txtcolor = ''Color of all text''
 
txtstyle = ''Style of all text''
 
image = [[File:''name_of_image''|''width_of_image''|''link_to_some_resource_or_page_at_this_wiki'']]
 
:link in format <nowiki>''http://...''</nowiki> or just name of page at this wiki (like "Template:Messagebox" '''without quotes''')
 
bgcolor = ''color of background''
 
borderstyle = ''style of special border, by default left border; can be defined but left blank for no special border''
 
bdcolor = ''color of special border''
 
bdcolor2 = ''color of overall box border''
 
margin = ''margin style''
 
padding = ''padding''
 
===Example===
<pre>
{{messagebox
|text = Text here
|small = Small text here
|txtcolor = Red
|txtstyle = italic
|image = [[File:en.png|55px|link=Template:Messagebox]] (Leave blank for Info.png)
|bgcolor = yellow
|bdcolor = green
|bdcolor2 = blue
|padding = 1em
}}
</pre>
 
Result:
{{messagebox
|text = Text here
|small = Small text here
|txtcolor = Red
|txtstyle = italic
|image = [[File:en.png|55px|link=Template:Messagebox]]
|bgcolor = yellow
|bdcolor = green
|bdcolor2 = blue
|padding = 1em
}}
[[Category:Notice templates|{{PAGENAME}}]]
</noinclude>

Revision as of 12:01, 15 February 2022


English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
View
Page history

Usage

A simple message box.

Parameters

All parameters except {{{text}}} are optional.
All parameters except {{{text}}}, {{{small}}} and {{{image}}} refer to the table that represents the overall box.

  • {{{text}}} - Main text.
  • {{{small}}} - Small text under main text.
  • {{{txtcolor}}} - Color of both texts, e.g. red or #ff0000.
  • {{{txtstyle}}} - Style of all text, default is normal.
  • {{{image}}} - An image. Default is [[File:Info.png|40px|link=]]. Use image= or image=None to get no image.
  • {{{bgcolor}}} - Background color. Default is #28374b.
  • {{{bgcolorgradient}}} - Background color with linear gradients. (Optional)
  • {{{bgcolorgradient2}}} - Same as above, but on the other side. (Optional)
  • {{{bgcolordeg}}} - Degrees for linear gradient.
  • {{{borderstyle}}} - Style of special border, which will be followed by {{{bdcolor}}}. Default is border-left: 10px solid. Use borderstyle= for no special border.
  • {{{bdcolor}}} - Special border color. Default is #537AA8.
  • {{{bdcolor2}}} - Overall box border color. Default is #525252.
  • {{{margin}}} - Margin style. Default is 0 10%.
  • {{{style}}} - More style parameters for the overall box, which is a table.

Examples

Wikitext Result
{{messagebox|text=Message text.}}
{{messagebox
|text = Text here
|small = Small text here
|txtcolor = pink
|txtstyle = italic
|image = [[File:en.png|55px|link=Template:Messagebox]]
|bgcolor = purple
|bdcolor = green
|bdcolor2 = yellow
|style=padding:1em
}}