Template:Message box/doc: Difference between revisions

(Created page with "{{documentation header}} {{shortcut|msgbox}} {{Protected|template|talkpage=Template talk:Msgbox}} This template is used to add consistent styling to message boxes. == Basic...")
 
No edit summary
 
Line 6: Line 6:


== Basic usage ==
== Basic usage ==
<pre style="width: 360px;">
<pre style="width: 400px;">
{{msgbox
{{msgbox
| title = This is a normal message box
| title = This is a normal message box
Line 14: Line 14:


Will result in:
Will result in:
{{msgbox| title = This is a normal message box | text = With helpful and descriptive subtext|nocat=1}}
{{Message box
| title = This is a normal message box
| text = With helpful and descriptive subtext
| nocat=1}}
 
 
An icon can be added to indicate the type of the message:


== Mini usage ==
<pre style="width: 460px;">
<pre style="width: 740px;">
{{msgbox
{{msgbox
| mini = 1
| icon = info-sign
| icon = 8
| text = This is a message box with an information icon
| text = This is a mini message box with an information icon using [[Template:CommentSprite]]
}}
}}
</pre>
</pre>


Will result in:
Will result in:
{{msgbox| mini = 1 | icon = 8 | text = This is a mini message box with an information icon using [[Template:CommentSprite]]|nocat=1}}
{{Message box
| icon = info-sign
| text = This is a message box with an information icon
|nocat=1}}
 
The [http://fortawesome.github.io/Font-Awesome/3.2.1/icons Font Awesome Icons] are used here (without the <code>icon-</code> prefix).


== Advanced usage ==
== Advanced usage ==
Line 33: Line 42:
| bgcol = #eef
| bgcol = #eef
| linecol = #ddf
| linecol = #ddf
| title = This is a blue message box
| textcol = #336
| text = It has a discuss link and some custom CSS
| icon = flag
| discuss = 1
| title = This is a purple message box
| text = It is customized with some extra CSS
| css = box-shadow: 0px 0px 6px #888;
| css = box-shadow: 0px 0px 6px #888;
}}
}}
Line 41: Line 51:


Will result in:
Will result in:
{{msgbox| bgcol = #eef | linecol = #ddf | title = This is a blue message box | text = It has a discuss link and some custom CSS | discuss = 1  = 340px | css = box-shadow: 0px 0px 6px #888;|nocat=1}}
{{Message box  
 
<pre style="width: 525px;">
{{msgbox
| bgcol = #eef
| bgcol = #eef
| linecol = #ddf
| linecol = #ddf
| title = This is a blue message box
| textcol = #336
| text = It has a discuss link, some custom CSS and a custom image
| icon = flag
| discuss = 1
| title = This is a purple message box
| image = Bot.png
| text = It is customized with some extra CSS
| css = box-shadow: 0px 0px 6px #888;
| css = box-shadow: 0px 0px 6px #888;
}}
|nocat=1}}
</pre>
 
Will result in:
{{msgbox| bgcol = #eef | linecol = #ddf | title = This is a blue message box | text = It has a discuss link, some custom CSS and a custom image | discuss = 1 | css = box-shadow: 0px 0px 6px #888 | image = Bot.png|nocat=1}}
 
A custom image size can also be specified with "imagewidth", for example: <code>imagewidth = 50px</code>
 
== Advanced mini usage ==
<pre style="width: 895px;">{{msgbox
| mini = 1
| image = Bot.png
| bgcol = #eef
| linecol = #ddf
| css = box-shadow: 0px 0px 6px #888;
| text = This is a mini message box, it is using similar settings as the box used in the advanced example above.
}}</pre>
 
Will result in: {{msgbox| mini = 1 | bgcol = #eef | linecol = #ddf | text = This is a mini message box, it is using similar settings as the box used in the advanced example above. | css = box-shadow: 0px 0px 6px #888;| image = Bot.png|nocat=1}}
This can also have a custom image size.


== Category ==
== Category ==
This template automatically adds templates that use it to [[:Category:Notice templates]]. To prevent that, simply set the parameter <code><nowiki>{{{nocat}}}</nowiki></code>
This template automatically adds templates that use it to [[:Category:Notice templates]]. To prevent that, simply set the parameter <code><nowiki>{{{nocat}}}</nowiki></code>

Latest revision as of 16:43, 1 August 2015

This is the documentation page, it should be transcluded into the main template page. See Template:Documentation for more information
Shortcut
msgbox


This template is used to add consistent styling to message boxes.

Basic usage

{{msgbox
| title = This is a normal message box
| text = With helpful and descriptive subtext
}}

Will result in:

This is a normal message box
With helpful and descriptive subtext


An icon can be added to indicate the type of the message:

{{msgbox
| icon = info-sign
| text = This is a message box with an information icon
}}

Will result in:

This is a message box with an information icon

The Font Awesome Icons are used here (without the icon- prefix).

Advanced usage

{{msgbox
| bgcol = #eef
| linecol = #ddf
| textcol = #336
| icon = flag
| title = This is a purple message box
| text = It is customized with some extra CSS
| css = box-shadow: 0px 0px 6px #888;
}}

Will result in:

This is a purple message box
It is customized with some extra CSS

Category

This template automatically adds templates that use it to Category:Notice templates. To prevent that, simply set the parameter {{{nocat}}}

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Need wiki hosting?

Do you need a wiki for your Minecraft mod/gaming wiki? We'll host it for free! Contact us.

Other wikis

Indie-game wikis
Powered by Indie Wikis