Template:TranscludeBox

Documentation
A DropBox whose contents are transcluded from elsewhere. This is useful for maintaining the contents of text boxes in a set of subpages. A relative link is is passed to this template and it is automatically transcluded as the contents of the box. When writing a book, this separates the contents of each information box from the main page: usually a desirable feature.

The contents of the box can be accessed directly by using the v d e (view, discuss, edit) links in the box title.

Parameters

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


 * Box contents are specified by one of the following
 * relpath
 * A relative path to the content of the box. This can also be taken from the 2nd unnamed parameter.
 * abspath
 * Instead of a relative path, use an absolute path (this currently does not give the correct link to the discussion page)
 * tplname
 * Instead of the relative or absolute paths, give a template name, e.g. Lorem

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 (default center)


 * ta2
 * the text-align for the body (default left)


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


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

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

Examples
Also see Template:DropBox for examples of other possible stylings.

The simplest example. In this documentation we can transclude Template:Lorem using a relative link, because the documentation is aslo in the template namespace. In most cases, you will probably want to transclude a page in the same namespace as your book, so you will want to use a relative link. or we could be more verbose, and give the parameter name

If we want to transclude a template in a page that is outside the Template namespace, we can't use a relative link, so we have to specify tplname rather than relpath.

An example where the headType has been set. Note that if the title is an unnamed parameter, make sure it is not followed by a carriage return, otherwise it will not appear in the TOC.

A more realistic example, rendered as (hopefully) seen on the right

/Templates

See also: Template:PrintTranscludeBox, for how this template will be rendered in a collection.