Template:Box: Difference between revisions

Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
m
left bracket workaround is unnecessary. fixed right bracket within its template.
No edit summary
m (left bracket workaround is unnecessary. fixed right bracket within its template.)
 
(8 intermediate revisions by the same user not shown)
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}}
Line 24: Line 24:
}}<!--
}}<!--


--><div class="{{#var:type}}box {{{class|}}}" style="{{#var:align}} width:{{{width|auto}}}; {{{style|}}}">{{#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|title=Example|Default light box with a title.}}{{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}}


Line 33: Line 33:
''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
{{TODO|Convert {{Temlink|Infobox}} and {{Temlink|Navbox}} to implement Box}}
**{{Temlink|Navbox}}
**{{Temlink|Userbox Container}}
**{{Temlink|Infobox}}
**{{Temlink|Languages}}
*Dark
*Dark
**{{Temlink|Disambig}}
**{{Temlink|Disambig}}
Line 42: Line 45:


==Usage==
==Usage==
{{Usage|dark?|align|width{{=}}|title{{=}}|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|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|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.
There are also ''class'' and ''style'' parameters.

Navigation menu