Template:Hidden

From Wikimedia Commons, the free media repository
Jump to: navigation, search
Documentation icon Documentationviewedithistorypurge

This documentation is transcluded from Template:Hidden/doc.

Usage

This template displays the first parameter (the header) with a ▼ (show) link on the right. If ▼ is clicked by the user, the second parameter (the content) is also displayed.

Optional parameters

  • style - add CSS to the main div
  • headerstyle - add CSS to the header
  • contentstyle - add CSS to the content
  • toggle - set to 'left' to align the text in the header to the left instead of the (default) center

Restrictions

Do not prefix the template with colon ":", otherwise the second parameter will not be hidden.
Does not work when in Preview mode.

Example with ":"
:{{Hidden|1=prefixed with colon parameter one|2=prefixed with colon parameter two}}

prefixing the template with a colon ":" forces the parameter to be always unhidden:

prefixed with colon parameter two

Examples

Using one 'Template:Hidden'

  • Example 1 :

{{Hidden|1=parameter one|2=parameter two}}

produces

  • Example 2 :

{{Hidden|toggle=left|1=toggle=left, parameter one|2=parameter two}}

produces

  • Example 3 :

{{Hidden|toggle=left|1=toggle=left, parameter one, newline in parameter two|2= parameter two}}

produces

  • Example 4 :

{{Hidden|toggle=left|1=toggle=left, parameter one, break in parameter two|2=<br /> parameter two}}

produces

  • Example 5 :

{{Hidden|style=background:yellow|1=parameter one|2=parameter two}}

produces

  • Example 6 :

{{Hidden|style=width: 50%;|headerstyle=background:#d0ffd0;|contentstyle=background:#ffe0e0;color:blue;|1=parameter one|2=parameter two}}

produces

Using two 'Template:Hidden'

  • Example 1 : (with frame)
{{Hidden|headerstyle=background:#ECECEC;|contentstyle=white;color:black|style=border:1px grey solid; padding:2px |1=title}}
Any content
{{Hidden|end}}

produces


  • Example 2 :
{{Hidden|style= width: 50%; |headerstyle= background:#d0ffd0; |contentstyle= background:#ffe0e0;color:blue; |1=parameter one}}
{| class="wikitable"
|Any
|content
|}
{{Hidden|end}}

produces

  • Example 3 :
{{Hidden|title|style=background:#ECECEC}}
content
{{Hidden end}}

produces

  • Example 4 :(without frame)
{{Hidden|headerstyle= background:#ECECEC; |contentstyle= white;color:black |1=title}}
Any content
{{Hidden|end}}

produces


See also