Template:Box: Difference between revisions

Want an adless experience? Log in or Create an account.
Integrated the edit link and added documentation for it and hide
(Integrated the edit link and added documentation for it and hide)
Line 24: Line 24:
}}<!--
}}<!--


--><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:{{{hide|}}}|{{Toggler|default={{{hide}}}}}}}</div>}}<div class="{{#if:{{{hide|}}}|_toggle_init{{{hide}}} _toggle}}">{{#if:{{#var:contents}}|{{#var:contents}}</div></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 45: 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.