Template:MessageBox: Difference between revisions

From Discord Dungeons Wiki
Jump to navigation Jump to search
(Created page with "<includeonly><table class="messagebox {{{class|}}}" style="{{{style|}}}"> <td style="width: {{{imgwidth|50px}}};">{{#if:{{{img|}}}|{{{img}}}|60x60px|center|link=}}</td> <td>'''{{#if:1|{{{1}}}|<!--this #if removes trailing/leading whitespace-->}}'''{{#if:{{{2|}}}|<br style="clear: both;" /><div style="font-size:0.85em; line-height:1.4em;">{{{2}}}</div>}}</td> </table></includeonly><noinclude>{{/doc}}</noinclude>")
 
No edit summary
 
Line 1: Line 1:
<includeonly><table class="messagebox {{{class|}}}" style="{{{style|}}}">
<includeonly>
<td style="width: {{{imgwidth|50px}}};">{{#if:{{{img|}}}|{{{img}}}|[[File:Tutor guide book detail.png|60x60px|center|link=]]}}</td>
<table class="messagebox {{{class|}}}" style="{{{style|}}}">
<td>'''{{#if:1|{{{1}}}|<!--this #if removes trailing/leading whitespace-->}}'''{{#if:{{{2|}}}|<br style="clear: both;" /><div style="font-size:0.85em; line-height:1.4em;">{{{2}}}</div>}}</td>
<td style="width: {{{imgwidth|50px}}};">{{#if:{{{img|}}}|{{{img}}}|[[File:Tutor guide book detail.png|60x60px|center|link=]]}}</td>
</table></includeonly><noinclude>{{/doc}}</noinclude>
<td>'''{{#if:1|{{{1}}}|<!--this #if removes trailing/leading whitespace-->}}'''{{#if:{{{2|}}}|<br style="clear: both;" /><div style="font-size:0.85em; line-height:1.4em;">{{{2}}}</div>}}</td>
</table>
</includeonly>
<noinclude>{{/doc}}</noinclude>

Latest revision as of 10:30, 31 March 2022

Template documentation
This documentation is transcluded from Template:MessageBox/doc. [edit] [history] [purge]

The MessageBox template is a wrapper for all types of message boxes. This includes licenses, Maintenance templates, and general notices used to alert the reader about something.

Parameters

To use this template, copy the following code and fill in the necessary information

{{MessageBox
|class = (optional) classes
|img = Image
|imgwidth = (optional) width of the table cell around the image
|Tagline text
|Extra information
}}

The first parameter is mandatory, but all further parameters are optional. A plain message box will look like this: {{MessageBox|Example of a messagebox with no customisation}}


Example of a messagebox with no customisation


First parameter

The first parameter will give the tagline for the message box. This is the most eye-catching info in the box and should be short and sweet.

Second parameter

The second parameter specifies more information about the message, and can be used to specify some more details about what information is being conveyed.

img

Specify an image here. Recommended is to include center, link= and a file size, to stylize the image properly. Just specifying the file name will not work with this parameter; the image needs to be given as a complete file link.

imgwidth

The width of the cell the image is (must specify px at the end), and defaults to 50px. This effectively sets the margins around the image, if the image is smaller than 50 px. It is typically best to omit this parameter, but in cases where the image is larger setting a custom width may be helpful.

class

A class to give the messagebox. Typically this is used for messageboxes that use custom styling which is defined in a class.

style

Inline CSS to give to the messagebox.

Example

An example of a template that has almost all parameters specified is the Stub template

{{MessageBox
|class = stub
|img = [[File:Stub.png|Stub|center|50px|link=]]
|This page is a [[DD_Wiki:Stubs|stub]].
|A stub is an article which does not cover all information available about the topic. You can help by [{{fullurl:{{FULLPAGENAME}}|action=edit}} expanding] it.
}}


This page is a stub.
A stub is an article which does not cover all information available about the topic. You can help by expanding it.