Difference between revisions of "Template:LeftBSCollapsible"

From Persona MUSH Wiki
Jump to: navigation, search
(Same)
(Troubleshooting BRs that crept in with that change)
 
Line 2: Line 2:
 
{{LeftBSCollapsible/doc}}
 
{{LeftBSCollapsible/doc}}
 
</noinclude>
 
</noinclude>
<includeonly>
+
<includeonly>{| style="margin-bottom: 5px; text-align: left; border: black solid 2px; color:#{{{maintext|000000}}}; background:#{{{bgcolor|FFFFFF}}};-moz-border-radius: 10px;border-radius: 10px"
{| style="margin-bottom: 5px; text-align: left; border: black solid 2px; color:#{{{maintext|000000}}}; background:#{{{bgcolor|FFFFFF}}};-moz-border-radius: 10px;border-radius: 10px"
+
 
! style="color:#{{{headtext|000000}}};background:#{{{headcolor|A6A6A6}}};font-size: 120%; text-align: center;width: 1500pt;-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>
 
! style="color:#{{{headtext|000000}}};background:#{{{headcolor|A6A6A6}}};font-size: 120%; text-align: center;width: 1500pt;-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>
 
|-
 
|-
| class="mw-collapsible-content; {{{class}}}" style="{{{style}}}" | <div class="mw-collapsible {{#if: {{{collapsed|}}} | mw-collapsed}}" id="mw-customcollapsible-{{{id}}}">
+
| class="mw-collapsible-content; {{{class}}}" style="{{{style}}}" | <div class="mw-collapsible {{#if: {{{collapsed|}}} | mw-collapsed}}" id="mw-customcollapsible-{{{id}}}"></includeonly>
</includeonly>
+

Latest revision as of 06:02, 16 July 2012

[edit] Scope

This template is based off of Template:LeftBS, 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:LeftBS.

[edit] Code

{{LeftBS
|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

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

Content Here


With some custom colors

{{LeftBSCollapsible
|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.

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

{{LeftBSCollapsible
|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