Template:Box: Difference between revisions

From Zelda Dungeon Wiki
Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
(added margins to floated boxes)
Line 3: Line 3:
-->{{#switch: {{lc:{{{1|}}}}}
-->{{#switch: {{lc:{{{1|}}}}}
  | dark = {{#vardefine:type|dark}}
  | dark = {{#vardefine:type|dark}}
  | left = {{#vardefine:align|float: left;}}
  | left = {{#vardefine:align|float: left; margin-right: 1em;}}
  | right = {{#vardefine:align|float: right;}}
  | right = {{#vardefine:align|float: right; margin-left: 1em;}}
  | center = {{#vardefine:align|margin: auto;}}
  | center = {{#vardefine:align|margin: auto;}}
  | {{Void}} = {{Void}}
  | {{Void}} = {{Void}}
Line 10: Line 10:
}}{{#switch: {{lc:{{{2|}}}}}
}}{{#switch: {{lc:{{{2|}}}}}
  | dark = {{#vardefine:type|dark}}
  | dark = {{#vardefine:type|dark}}
  | left = {{#vardefine:align|float: left;}}
  | left = {{#vardefine:align|float: left; margin-right: 1em;}}
  | right = {{#vardefine:align|float: right;}}
  | right = {{#vardefine:align|float: right; margin-left: 1em;}}
  | center = {{#vardefine:align|margin: auto;}}
  | center = {{#vardefine:align|margin: auto;}}
  | {{Void}} = {{Void}}
  | {{Void}} = {{Void}}
Line 17: Line 17:
}}{{#switch: {{lc:{{{3|}}}}}
}}{{#switch: {{lc:{{{3|}}}}}
  | dark = {{#vardefine:type|dark}}
  | dark = {{#vardefine:type|dark}}
  | left = {{#vardefine:align|float: left;}}
  | left = {{#vardefine:align|float: left; margin-right: 1em;}}
  | right = {{#vardefine:align|float: right;}}
  | right = {{#vardefine:align|float: right; margin-left: 1em;}}
  | center = {{#vardefine:align|margin: auto;}}
  | center = {{#vardefine:align|margin: auto;}}
  | {{Void}} = {{Void}}
  | {{Void}} = {{Void}}

Revision as of 21:13, April 8, 2013

size=40x40px This template is used on over 2500 pages. Take extra care when making changes, testing them in a sandbox first. If changes to this template require changes to pages that use it, you are responsible for making those changes.
Example
Default light box with a title.
Dark box floated right.

Purpose

This template creates a standard box, into which content or other templates can be placed. It currently supports two types: light and dark. Light boxes are usually utilized by other templates to set aside supplemental information, while dark boxes usually contain metadata for which an {{Ambox}} may not be appropriate.

Known Implementers

This list may not be kept up-to-date. For a more accurate list, see [[Box Templates]].

TODO: Convert {{Infobox}} to implement Box

Usage

{{Box| dark? | align | width= | title= | contents }}

  • dark? — Boxes are light by default. For a dark box, use the argument "dark". (Optional. Default: light)
  • align — "left", "right", or "center". Left and right float the box so other content wraps around it. (Optional.)
  • width — Width of the box, including units (such as "px", "em", "%"). (Optional.)
  • title — Title to be placed on the top of the box. (Optional.)
  • contents — Everything that goes inside the box. (Optional.)

There are also class and style parameters.

For contents that would be inconvenient to pass as an argument to a template due to high use of equal signs or pipe characters, such as tables, the contents can instead be included immediately after this template declaration and followed by {{Box/Bottom}}. e.g.:

{{Box|right}}
{| class="wikitable"
| table
|}
{{Box/Bottom}}