Template:Fmbox: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(+docs)
m (excess spaces annoy me)
Line 40: Line 40:
First let's start with a basic warning-type box.
First let's start with a basic warning-type box.
<pre>{{fmbox
<pre>{{fmbox
   | type = warning
   | type = warning
   | text = Warning. You did not tie your shoelaces. Ha ha. Made you look.
   | text = Warning. You did not tie your shoelaces. Ha ha. Made you look.
   }}</pre> yields:
   }}</pre> yields:
{{fmbox
{{fmbox
   | type = warning
   | type = warning
   | text = Warning. You did not tie your shoelaces. Ha ha. Made you look.
   | text = Warning. You did not tie your shoelaces. Ha ha. Made you look.
   }}
   }}


Line 54: Line 54:
   | style = background: #ecfcf4;
   | style = background: #ecfcf4;
   | image = none
   | image = none
   | text = Sorry, even computers need to lighten things up once in a while.
   | text = Sorry, even computers need to lighten things up once in a while.
   }}</pre> yields:
   }}</pre> yields:
{{fmbox
{{fmbox
   | style = background: #ecfcf4;
   | style = background: #ecfcf4;
   | image = none
   | image = none
   | text = Sorry, even computers need to lighten things up once in a while.
   | text = Sorry, even computers need to lighten things up once in a while.
   }}
   }}


Line 65: Line 65:
For a generic "info" message, you can keep it simple (no image parameter is given, so Fmbox uses the icon from its "editnotice" style, but the "system" style for the box's appearance):
For a generic "info" message, you can keep it simple (no image parameter is given, so Fmbox uses the icon from its "editnotice" style, but the "system" style for the box's appearance):
<pre>{{fmbox
<pre>{{fmbox
   | text = Computers make bad jokes.
   | text = Computers make bad jokes.
   }}</pre> yields:
   }}</pre> yields:
{{fmbox
{{fmbox
   | text = Computers make bad jokes.
   | text = Computers make bad jokes.
   }}
   }}
<br /><br />
<br /><br />

Revision as of 18:48, 8 April 2013

Gonna be honest -- I basically brought this over as a hasty cut-and-paste so I could get the Template:Script doc auto system to work. This is one of Wikipedia's standard templates for making message boxes with the color and message icon of your choice. The template is somewhat redundant of Template:Divbox, except that this is a more powerful, less user-friendly version. --Iritscen

Sample usages
The most interesting parameter is "type" -- you can choose either "warning", "editnotice", or "system". These types have different appearances, based on classes defined in MediaWiki:Common.css. We'll explore a few ways to use Fmbox below, but see the link at the bottom for more information on the many abilities of this template.

First let's start with a basic warning-type box.

{{fmbox
  | type = warning
  | text = Warning. You did not tie your shoelaces. Ha ha. Made you look.
  }}

yields:


Here we define our own background, so we don't bother with passing in a "type":

{{fmbox
  | style = background: #ecfcf4;
  | image = none
  | text = Sorry, even computers need to lighten things up once in a while.
  }}

yields:


For a generic "info" message, you can keep it simple (no image parameter is given, so Fmbox uses the icon from its "editnotice" style, but the "system" style for the box's appearance):

{{fmbox
  | text = Computers make bad jokes.
  }}

yields:



This was just Fmbox 101; there's a ton more functionality in this template, but I'm not going to document it all here. Read the template's original docs here for all the gory details: wikipedia:Template:Fmbox.