Template:DropBox/doc

Documentation
A PrettyTextBox that can be shown or hidden, designed to act as a "box" in the style of separate information boxes as seen in textbooks (often labelled Box 1.1, etc.). This requires a title, which can be seen even when the contents of the box are hidden. Much of this functionality is copied from Template:Hidden. By default, the box is shown, unless the "hidden" parameter is set.

For extensive box contents which are relatively independent of the main text, consider using Template:TranscludeBox, which allows you to place the contents in a subpage of your book, and transclude it into the main page.

Parameters
This template displays the first parameter (the heading) with a [Show] link on the right. If the heading box or [Show] link is clicked by the user, the second parameter (the content) is also displayed. The following parameters are also available:


 * header
 * The heading for the box (e.g. Box 1.1). This can also be taken from the 1st unnamed parameter.


 * content
 * The content of the box. This can also be taken from the 2nd unnamed parameter.

Conventional css parameters

 * fw1
 * the font-weight for the heading


 * fw2
 * the font-weight for the body


 * bg
 * the background-color for the enclosing box


 * bg1
 * the background-color for the heading


 * bg2
 * the background-color for the body


 * ta1
 * the text-align for the heading


 * ta2
 * the text-align for the body


 * float
 * should the box be floated? (left, right, or none)


 * width
 * the width of the box, e.g. 33%


 * style
 * HTML/CSS affectionados only: any other css style arguments for the whole box

Special parameters

 * hidden
 * set this to any string (e.g. hidden=true) to have the box hidden by default


 * headType
 * allows you to set the box header to (say) "h4", which means it will be included in the table of contents. This is provided as an explicit parameter because if you just surround the title with header tags, e.g.
 * Box 1.1
 * Then the title will be displaced downwards by the show/hide button. See examples below.


 * preHead
 * allows you to specify stuff to place before the header. This is used, e.g. in Template:TranscludeBox.


 * dropClass
 * (default = collapsible) The class of the dropbox which determines the drop-down behaviour. Setting this to something other than collapsible will remove the drop-down behaviour of the box.


 * boxClass
 * (default = PrettyTextBox) The class of the dropbox which determines the style.

Examples
The simplest example renders as:

To hide by default, specify a value for "hidden" renders as:

A more realistic example, setting the title to h4 which will place it in the TOC. This is produced by renders as seen on the left

Another similar layout, styled differently, and hidden by default. This is produced by renders as seen on the right