Template:Hidden/doc

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

Usage[edit]

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[edit]

  • 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[edit]

Do not prefix the template with colon ":", otherwise the second parameter will not be hidden.

Does not work when in Preview mode.

Examples[edit]

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


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



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



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


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


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


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


See also[edit]