Jump to content

Template:Collapse top: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m pp
try a fix
Line 1: Line 1:
{<noinclude></noinclude>{{!}} <!-- Template:Collapse top --> class="navbox collapsible {{#if:{{{expand|}}}||collapsed}}" style="text-align: left; border: {{{border|1px}}} solid silver; margin-top: 0.2em;"
{<noinclude></noinclude>{{!}} <!-- Template:Collapse top --> class="navbox collapsible {{#if:{{{expand|}}}||collapsed}}" style="text-align: left; border: {{{border|1px}}} solid silver; margin-top: 0.2em;"
{{!}}-
{{!}}-
! style="background-color: {{{bg|#CFC}}};" {{!}} {{{1|Extended content}}}
! style="background-color: {{{bg|#CFC}}};" {{!}} {{{1|{{{title}}}|Extended content}}}
{{!}}-
{{!}}-
{{!}} style="border: solid 1px silver; padding: {{{padding|8px}}}; background-color: white; " {{!}}<noinclude>
{{!}} style="border: solid 1px silver; padding: {{{padding|8px}}}; background-color: white; " {{!}}<noinclude>

Revision as of 16:11, 17 January 2010

  • Adding a standard warning line – {{collapse top|This is the title text|warning=true}}
  • Adding a custom warning line – {{collapse top|This is the title text|This is a custom warning line}}
  • Aligning box title along left margin – {{collapse top|left=true}}
  • Changing background color – {{collapse top|bg=#F0F2F5}}
  • Adding extra padding – {{collapse top|padding=5em}}
  • Archiving a section: the markup below:
{{collapse top}}
==Section header==
Sample contents text
{{collapse bottom}}

must be rewritten as:

{{collapse top|Section header}}
Sample contents text
{{collapse bottom}}

The end result:

Limitations

  • This functionality requires the end-user's browser to have JavaScript enabled. If JavaScript is disabled, the default behavior is to show the content.

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Collapse top in articles based on its TemplateData.

TemplateData for Collapse top

Use in conjunction with {{Collapse bottom}}. Will collapse text in between the two templates.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Title1 title heading header reason result

Main title of collapsed box

Default
Extended content
Example
This is the title text
Lineoptional
Custom warning line2

Will override the standard warning line, and make the 'warning' parameter unnecessary

Default
The following is a closed discussion. {{strongbad|Please do not modify it.}}
Example
This is a custom warning line
Stringoptional
Indent (px or em)indent

Indents the box from the left of the page

Auto value
0px
Unknownoptional
expandexpand collapse

Using expand=yes or collapse=no will leave the material uncollapsed with the border and coloring

Example
true
Auto value
Stringoptional
Border width (px)border

Sets the width of the border line on the collapsed material

Default
1px
Example
2px
Auto value
Unknownoptional
Border colorb-color

Sets the border color

Default
Silver
Example
#F0F2F5
Unknownoptional
Template width (% or em)width

Sets the width of the overall template

Example
50%
Unknownoptional
Collapsed material background colorbg

Sets the background color of the collapsed material

Default
#CFC
Example
#F0F2F5
Unknownoptional
Alight along the left margin (true or blank)left

Will align the 'parameter 1 title' along the left margin

Example
true
Stringoptional
Title font colorfc

Sets the font color of the title of the collapsible bar

Default
Black
Example
#F0F2F5
Unknownoptional
Warning (true or blank)warning

Will display a default warning line under the main title which reads "The following is a closed debate. Please do not modify it."

Example
true
Unknownoptional
Expanded box border size & colorborder2

Sets the border of the box that appears when template is expanded

Default
1px silver
Example
2px
Unknownoptional
Padding (px)padding

Sets the padding on the collapsed material in the colored area

Default
8px
Example
16px
Unknownoptional
Expanded box colorbg2

Sets background of the box that appears when template is expanded

Default
white
Example
#F0F2F5
Unknownoptional

Redirects

To Collapse top:

To Collapse bottom:

See also