Jump to content

Template:Hidden

From Wikitech
{{{1}}}

{{{2}}}

Template documentation


This template creates a dynamic navigation box. It has sister templates at:

Usage

This template displays the first parameter (the heading) with a [show] link on the right. If [show] is clicked by the user, the second parameter (the body) is displayed below the heading and the [show] link becomes [hide]. Clicking on [hide] then hides the body again and the [hide] link becomes [show] again.

Full syntax

{{Hidden
| expanded=true <!--(omit for initial hidden state)-->
| style = 
| headerstyle = 
| header = 
| contentstyle = 
| content =

|titlebgcolor= |contentbgcolor= |ta1= |ta2= |fw1= |fw2= |class= |border=
}}

Parameters

Only two parameters are required for this template:

header
text for header (title); alternative to using unnamed parameter {{{1}}}
content
text for body (content); alternative to using unnamed parameter {{{2}}}

The following parameters are optional:

fw1
the font-weight for the heading (default "bold")
fw2
the font-weight for the body (default "normal")
bg1
the background-color for the heading (default "#CCF")
bg2
the background-color for the body (default "transparent")
ta1
the text-align for the heading (default "center")
ta2
the text-align for the body (default "left")
state
The initial state the content should have: collapsed (default) or expanded.
headercss
add CSS to the header.
contentcss
add CSS to the content box.


Note: This template will not respect the user preference "justify paragraphs".

With ta1=right or a long header the header overlaps the show/hide link (at least in some browsers):

abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc abc

def

abc

def

 

abc

def