Difference between revisions of "Template:RightBSCollapsible"

From Persona MUSH Wiki
Jump to: navigation, search
 
Line 2: Line 2:
 
{{RightBSCollapsible/doc}}
 
{{RightBSCollapsible/doc}}
 
</noinclude>
 
</noinclude>
<includeonly>
+
<includeonly>{| style="float: right; clear: right; width: 25em; margin-left: 5px; margin-top: 5px; border: black solid 2px; color:#{{{maintext|000000}}}; background:#{{{bgcolor|FFFFFF}}};-moz-border-radius: 10px;border-radius: 10px"
{| style="float: right; clear: right; width: 25em; margin-left: 5px; margin-top: 5px; border: black solid 2px; color:#{{{maintext|000000}}}; background:#{{{bgcolor|FFFFFF}}};-moz-border-radius: 10px;border-radius: 10px"
+
 
|-
 
|-
 
| colspan="2" style="color:#{{{headtext|000000}}};background:#{{{headcolor|A6A6A6}}};font-size: 120%; text-align: center;-moz-border-radius-topright: 7px;border-top-right-radius: 7px;-moz-border-radius-topleft: 7px;border-top-left-radius: 7px" | <div class="mw-customtoggle-{{{id}}}">'''{{{title}}}'''</div>
 
| colspan="2" style="color:#{{{headtext|000000}}};background:#{{{headcolor|A6A6A6}}};font-size: 120%; text-align: center;-moz-border-radius-topright: 7px;border-top-right-radius: 7px;-moz-border-radius-topleft: 7px;border-top-left-radius: 7px" | <div class="mw-customtoggle-{{{id}}}">'''{{{title}}}'''</div>
 
|-
 
|-
 
| colspan="2" class="mw-collapsible-content; {{{class}}}" style="{{{style}}}" | <div class="mw-collapsible {{#if: {{{collapsed|}}} | mw-collapsed}}" id="mw-customcollapsible-{{{id}}}"></includeonly>
 
| colspan="2" class="mw-collapsible-content; {{{class}}}" style="{{{style}}}" | <div class="mw-collapsible {{#if: {{{collapsed|}}} | mw-collapsed}}" id="mw-customcollapsible-{{{id}}}"></includeonly>

Latest revision as of 06:06, 16 July 2012

[edit] Scope

This template is based off of Template:RightBS, but implements collapsible boxes. There are a few important differences:

  • Use Template:BoxEndCollapsible to end this template. Don't use Template:BoxEnd.
  • Template:BoxEndCollapsible requires you to specify parameters, you can't just use {{BoxEndCollapsible}} by itself.
  • Do not start the contents of the box with a | character, this template does that for you. It's necessary to make the javascript work right.
  • Use the "style" and "class" template parameters if you need to set styles for the first table cell.
  • There is a new parameter called "id" that is mandatory for both this template and the {{BoxEndCollapsible}} that terminates it.

It is otherwise identical to Template:RightBS.

[edit] Code

{{RightBS
|id = A unique ID for this box that does not contain a space. It can be the same as the title if it has no space.
      The same ID must be used for the {{BoxEndCollapsible}} that terminates this template.
|collapsed = Optional. Set collapsed=1 if you want this box collapsed on page load.
|style = The CSS style(s) for the contents of the box. Separate them with semicolons as usual.
|class = The CSS class(es) for the contents of the box.
|maintext = This is the color of the box text. Insert the hex number for the color you want to use. The default is 000000 (aka Black). 
|bgcolor = This is the background color of the box. Insert the hex number for the color you want to use. The default is FFFFFF (aka White). 
|headcolor = This is the background color of the header. Insert the hex number for the color you want to use. The default is A6A6A6 (aka a light gray). 
|headtext = This is the color of the header text. Insert the hex number for the color you want to use. The default is 000000 (aka Black). 
|title=
}}

[edit] Usage

With all default colors

{{RightBSCollapsible
|title=Example 1
|id=example1
}}
Content Here
{{BoxEndCollapsible
|id=example1}}
Example 1

Content Here


With some custom colors

{{RightBSCollapsible
|bgcolor = FCDDDD 
|headcolor = DDFCDD
|title=Example 2
|id=example2
}}
Content Here
{{BoxEndCollapsible
|bgcolor = FCDDDD 
|headcolor = DDFCDD
|id=example2
}}
Example 2

Content Here


Two boxes, one collapsed and one not.

{{RightBSCollapsible
|bgcolor = FCDDDD 
|headcolor = DDFCDD
|title=Example 3
|id=example3
|collapsed=1
}}
Content Here
{{BoxEndCollapsible
|bgcolor = FCDDDD 
|headcolor = DDFCDD
|title=Example 3
|id=example3
}}

{{RightBSCollapsible
|bgcolor = FCDDDD 
|headcolor = DDFCDD
|title=Example 4
|id=example4
}}
Content Here
{{BoxEndCollapsible
|bgcolor = FCDDDD 
|headcolor = DDFCDD
|title=Example 4
|id=example4
}}
Example 3

Collapsed



Example 4

Uncollapsed



Personal tools
Namespaces

Variants
Actions
Navigation
Wiki Tools
Toolbox