Difference between revisions of "Template:MessageBox"

From relax wiki
Jump to navigation Jump to search
(Added a 'max-width' style so the message box is never greater than 80% of the width of the element it sits in.)
(Added an m-space between the title and message.)
Line 1: Line 1:
 
{| cellspacing="0" style="border: {{{border|thin solid #88cbff}}}; border-left-width: 10px; background-color: {{{bgcolor|#e5feff}}}; width: auto; clear:both; padding: 5px 20px 5px 20px; margin: 0px auto 0px auto; max-width: 80%"
 
{| cellspacing="0" style="border: {{{border|thin solid #88cbff}}}; border-left-width: 10px; background-color: {{{bgcolor|#e5feff}}}; width: auto; clear:both; padding: 5px 20px 5px 20px; margin: 0px auto 0px auto; max-width: 80%"
| {{#if: {{{title|}}}| '''{{{title}}}'''}} {{{message|Add message}}}
+
| {{#if: {{{title|}}}| '''{{{title}}}'''}}   {{{message|Add message}}}
 
|}<noinclude>
 
|}<noinclude>
  

Revision as of 19:11, 15 October 2015

  Add message

Goal

To create a unified system for relax message box templates.

Usage

{{MessageBox|message|title=|border=|bgcolor=}}
message 
The obligatory message box text.
title 
The optional message box title, which will precede the message box text and be in bold format.
border 
The CSS border style to use, defaulting to the relax thin blue border.
bgcolor 
The CSS background-color style to use, defaulting to the relax website background colour.

Example

{{MessageBox
| message = This is a test message
| title   = Warning
| border  = thin solid #f42
| bgcolor = #ffe0d0
}}
Warning   This is a test message

The Inform MessageBox Series

Note   This idea of using a meta-template transclusion was suggested by Johan G. on the FlightGear wiki. The {{tip}}, {{note}}, {{caution}}, and {{warning}} message box colour scheme and names were also devised by Johan, based on a "typical flight manual/pilot operating handbook and cockpit indicator use, all sometimes defined by regulation to be used for notes of importance, cations about risk of damaging equipment or minor physical injuries and warnings about major damage to equipment, major physical injuries or death".

The following are a series of message boxes for helping to inform the reader:

For example if you use:

{{tip|If you do it this way, your life will be easier.}}
{{note|Do not forget to run this command.}}
{{caution|If you run this command incorrectly, your harddrive will be erased.}}
{{warning|Do not delete all files from your harddrive.}}

The result will be:


Tip   If you do it this way, your life will be easier.
Note   Do not forget to run this command.
Caution   If you run this command incorrectly, your harddrive will be erased.
Warning   Do not delete all files from your harddrive.

These message boxes all use transclusion from {{MessageBox}}.