This page is protected against editing.

Template:Hidden

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Protected This template has been protected from editing to prevent vandalism.
Please discuss changes on the talk page or request unprotection.
Documentationview · edit · history · purge ]
This documentation is transcluded from Template:Hidden/doc.

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.

Usage

{{Hidden |1= |2= }}

Do not prefix the template with colon ":", otherwise the second parameter will not be hidden.
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

Template parameters

ParameterDescriptionDefaultStatus
1
header
headerThe header of the hidden content, or ‘end’ to produce a box closing. The header is always visible; this is the text that gets the arrow next to it.emptyrequired
2
content
contentThe hidden content. If not specified, you should use another {{Hidden|end}} to close the hidden box, and put content between the two.emptyoptional
style
css
additional CSSAdd CSS to the main divemptyoptional
headerstyle
headercss
additional header CSSAdd CSS to the headeremptyoptional
contentstyle
contentcss
additional content CSSAdd CSS to the content. Works with both content passed as parameter and with content put between the two templates.emptyoptional
toggletoggle positionSet to ‘left’ to align the text in the header to the leftcenteroptional
statusstatusWhether to collapse the box initiallycollapsedoptional
hlisthlistSpecify any value to format the content horizontally when the content is a list. Works only with content passed as a parameter.emptyoptional
fw1heading font weightThe CSS font weight for the heading. Use ‘headerstyle’ parameter instead.bolddeprecated
fw2body font weightThe CSS font weight for the body. Use the ‘bodystyle’ parameter instead.normaldeprecated
bg1heading background colorThe CSS background color for the heading. Use ‘headerstyle’ parameter instead.transparentdeprecated
bg2body background colorThe CSS background color for the body. Use the ‘bodystyle’ parameter instead.transparentdeprecated
ta2body text alignThe CSS text align for the body. Use the ‘bodystyle’ parameter instead.startdeprecated
Template data
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either useTemplateData=1 or useTemplateData=only on the /doc subpage and transcluding it with {{Documentation}} into the template. <nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw <templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

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.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
header1 header

The header of the hidden content, or ‘end’ to produce a box closing. The header is always visible; this is the text that gets the arrow next to it.

Contentrequired
content2 content

The hidden content. If not specified, you should use another {{Hidden|end}} to close the hidden box, and put content between the two.

Contentoptional
heading background colorbg1

The CSS background color for the heading. Use ‘headerstyle’ parameter instead.

Default
transparent
Linedeprecated
body background colorbg2

The CSS background color for the body. Use the ‘bodystyle’ parameter instead.

Default
transparent
Linedeprecated
additional content CSScontentstyle contentcss

Add CSS to the content. Works with both content passed as parameter and with content put between the two templates.

Lineoptional
heading font weightfw1

The CSS font weight for the heading. Use ‘headerstyle’ parameter instead.

Default
bold
Linedeprecated
body font weightfw2

The CSS font weight for the body. Use the ‘bodystyle’ parameter instead.

Default
normal
Linedeprecated
additional header CSSheaderstyle headercss

Add CSS to the header

Lineoptional
hlisthlist

Specify any value to format the content horizontally when the content is a list. Works only with content passed as a parameter.

Lineoptional
statusstatus

Whether to collapse the box initially

Default
collapsed
Lineoptional
additional CSSstyle css

Add CSS to the main div

Lineoptional
body text alignta2

The CSS text align for the body. Use the ‘bodystyle’ parameter instead.

Default
start
Linedeprecated
toggle positiontoggle

Set to ‘left’ to align the text in the header to the left

Default
center
Lineoptional

Additional information

The template is intended to be used in the following namespaces: no namespace specified

The template is intended to be used by the following user groups: no user group specified

Relies on:
The functionality is depending on MediaWiki:Gadget-CollapsibleTemplates.

See also

Localization

This template is not intended to be localized.

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:#CFC;|contentstyle=background:#FDD;color:blue;|1=parameter one|2=parameter two}}

produces

Using two 'Template:Hidden'

  • Example 1 : (with frame)
{{Hidden|headerstyle=background:#EEE;|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:#CFC; |contentstyle= background:#FDD;color:blue; |1=parameter one}}
{| class="wikitable"
|Any
|content
|}
{{Hidden|end}}

produces

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

produces

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

produces