Template:Box: Difference between revisions

Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
1,245 bytes added ,  August 13, 2014
m
left bracket workaround is unnecessary. fixed right bracket within its template.
(Created page with "<onlyinclude><includeonly>{{#vardefine:type|}}{{#vardefine:align|}}{{#vardefine:contents|}}<!-- -->{{#switch: {{lc:{{{1|}}}}} | dark = {{#vardefine:type|dark}} | left = {{#v...")
 
m (left bracket workaround is unnecessary. fixed right bracket within its template.)
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{High Use}}
<onlyinclude><includeonly>{{#vardefine:type|}}{{#vardefine:align|}}{{#vardefine:contents|}}<!--
<onlyinclude><includeonly>{{#vardefine:type|}}{{#vardefine:align|}}{{#vardefine:contents|}}<!--
-->{{#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 9: 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 16: 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}}
Line 23: Line 24:
}}<!--
}}<!--


--><div class="{{#var:type}}box" style="{{#var:align}} width={{{width|80%}}}">{{#if: {{{title|}}} | <div class="title">{{{title}}}</div> |}}{{#if: {{#var:contents}} | {{#var:contents}}</div> |}}</includeonly></onlyinclude>
--><div class="{{#var:type}}box {{{class|}}}" style="{{#var:align}} {{#if:{{{width|}}}|width:{{{width}}};}} {{{style|}}}">{{#if:{{{title|}}}|<div class="title" style="text-align:{{{titlealign|center}}}">{{{title}}}{{#if:{{{edit|}}}|<span class{{=}}"edit plainlinks">[{{fullurl:{{{edit}}}|action=edit}} [edit{{)!}}]</span>}}{{#if:{{{hide|}}}|{{Toggler|default={{{hide}}}}}}}</div>}}<div class="{{#if:{{{hide|}}}|_toggle_init{{{hide}}} _toggle}}">{{#if:{{#var:contents}}|{{#var:contents}}</div></div>}}</includeonly></onlyinclude>
{{Box|Default light box.}}{{Box|dark|right|Dark box floated right.}}{{Clear}}
{{Box|title=Example|Default light box with a title.}}{{Box|dark|right|Dark box floated right.}}{{Clear}}


==Purpose==
==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 {{Temlink|Ambox}} may not be appropriate.
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 {{Temlink|Ambox}} may not be appropriate.


===Known Implementors===
===Known Implementers===
''This list may not be kept up-to-date. For a more accurate list, see {{Catlink|Box Templates}}.''
''This list may not be kept up-to-date. For a more accurate list, see {{Catlink|Box Templates}}.''
*Light
*Light
**{{Temlink|Navbox}}
**{{Temlink|Userbox Container}}
**{{Temlink|Infobox}}
**{{Temlink|Infobox}}
**{{Temlink|Navbox}}
**{{Temlink|Languages}}
*Dark
*Dark
**{{Temlink|Disambig}}
**{{Temlink|Disambig}}
**{{Temlink|TODO}}
**{{Temlink|TODO}}
**{{Temlink|Copyright}}
**{{Temlink|General License}}
**{{Temlink|Fanart}}
**{{Temlink|Fanart License}}
**{{Temlink|User License}}


==Usage==
==Usage==
Basic usage: {{Usage|dark?|align|contents}}
{{Usage|dark?|align|width{{=}}|title{{=}}|edit{{=}}|hide{{=}}|contents}}
{{Usage/Param|dark?|Boxes are light by default. For a dark box, use the argument "dark".|optional|light}}
{{Usage/Param|dark?|Boxes are light by default. For a dark box, use the argument "dark".|optional|light}}
{{Usage/Param|align|"left", "right", or "center". Left and right float the box so other content wraps around it.|optional}}
{{Usage/Param|align|"left", "right", or "center". Left and right float the box so other content wraps around it.|optional}}
{{Usage/Param|width|Width of the box, including units (such as "px", "em", "%").|optional}}
{{Usage/Param|title|Title to be placed on the top of the box.|optional}}
{{Usage/Param|edit|This places an [edit] link on the left side of the title if present. Use this parameter to define the name of the page that would be edited when the link is clicked. Keep in mind that <nowiki>{{PAGENAME}}</nowiki> resolves to the name of the page the template is transcluded on, not the template itself.|optional}}
{{Usage/Param|hide|This places a [hide] link on the right side of the title if present. Pass "hide" to make the contents (except the title) hidden by default, or "show" to make them visible by default.|optional}}
{{Usage/Param|contents|Everything that goes inside the box.|optional}}
{{Usage/Param|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 {{Usage|sub=Bottom}}.
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 {{Usage|sub=Bottom}}. ''e.g.'':


{{Usage/Example}}
<pre>{{Box|right}}
<pre>{{Box|right}}
{| class="wikitable"
{| class="wikitable"
| table
| table
|}
|}
{{Box/Bottom}}</pre>}}
{{Box/Bottom}}</pre>
{{Usage/Result|
{{Box|right}}
{{(!}} class="wikitable"
{{!}} table
{{!)}}
{{Box/Bottom}}}}




{{Cat|Formatting Templates}}
{{Cat|Formatting Templates}}
{{Cat|Box Templates}}
{{Cat|Box Templates}}

Navigation menu