Template:MessageBox: Difference between revisions

From OtherX
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!--
<includeonly><table class="messagebox {{{class|}}}" role="presentation"><tr><td class="messagebox-image" style="width: {{{imgwidth|50px}}}; padding: {{{imgpadding|5px}}};">{{{img|[[File:Blue chathead.png|x45px|center|link=]]}}}</td><td style="padding: {{{textpadding|10px}}};"><span class="messagebox-title" style="font-weight: bold; {{{titlestyle|}}}" >{{{1|}}}</span><div style="font-size:0.85em; line-height:1.4em; {{{textstyle|}}}" class="messagebox-text">{{{2|}}}</div></td></tr></table></includeonly><noinclude>{{/doc}}</noinclude>
<includeonly>
<table class="messagebox {{{class|}}}" style="{{{style|}}}" role="presentation">
  <tr>
    <td class="messagebox-image" style="width: {{{imgwidth|50px}}};">
      {{{img|[[File:Blue chathead.png|60x60px|center|link=]]}}}
    </td>
    <td>
      <span class="messagebox-title"><b>{{{1|}}}</b></span>
      <br style="clear: both;" />
      <div style="font-size:0.85em; line-height:1.4em;" class="messagebox-text">{{{2|}}}</div>
    </td>
    <td class="messagebox-image messagebox-imageright" style="width: {{{imgrightwidth|50px}}};">
      {{{imgright|}}}
    </td>
  </tr>
</table>
</includeonly>
<noinclude>{{/doc}}</noinclude>
-->
 
<includeonly>
<table class="messagebox {{{class|}}}" role="presentation">
  <tr>
    <td class="messagebox-image" style="width: {{{imgwidth|50px}}}; padding: {{{imgpadding|5px}}};">
      {{{img|[[File:Blue chathead.png|60x60px|center|link=]]}}}
    </td>
    <td style="padding: {{{textpadding|10px}}};">
      <span class="messagebox-title" style="clear: both; font-weight: bold; {{{titlestyle|}}}" >{{{1|}}}</span>
      <div style="font-size:0.85em; line-height:1.4em; {{{textstyle|}}}" class="messagebox-text">{{{2|}}}</div>
    </td>
    <td class="messagebox-image messagebox-imageright" style="width: {{{imgrightwidth|50px}}}; padding: {{{imgrightpadding|5px}}};">
      {{{imgright|}}}
    </td>
  </tr>
</table>
</includeonly>
<noinclude>{{/doc}}</noinclude>

Latest revision as of 14:24, 4 February 2024

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}}

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 [[RuneScape: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.
}}