Difference between revisions of "Template:Hidden/doc"

From blackwiki
Jump to navigation Jump to search
imported>SMcCandlish
m (→‎CSS: code consistency)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<!-- Categories go where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata]]). -->
+
<!-- Categories go where indicated at the bottom of this page, please; interwikis go to Wikidata  
{{high-use| 111160 }}
+
 
{{Template:Collapse Templates}}
 
  
This template creates a [[Wikipedia:NavFrame|dynamic navigation box]] using style sheet declarations in [[MediaWiki:Common.css]] and Javascript code in [[MediaWiki:Common.js]]. In a saved, [[Rendering (computer graphics)|rendered]] page this template creates a clickable link that toggles between [show] and [hide]. It displays the first parameter (the heading) with a [show] link on the right.  If [show] is clicked by the user, it displays the second parameter (the body) below the heading and the [show] link becomes [hide].  Clicking on [hide] then hides the body and the [hide] link becomes [show] again.
+
Generally, collapsible templates should not be used in articles. For allowable uses and other considerations,  
 
 
If this template is nested in another, the show/hide links in the hidden content keep their state; there is no parameter for ''collapse all'' or ''reveal all''. 
 
 
 
Generally, collapsible templates should not be used in articles. For allowable uses and other considerations, please see [[MOS:COLLAPSE]].
 
 
 
== Usage ==
 
 
 
===Full syntax===
 
<pre style="overflow:auto;">
 
{{Hidden
 
| expanded=true  <!--(omit for initial hidden state)-->
 
| style =
 
| headerstyle =
 
| header =
 
| contentstyle =
 
| content =
 
 
 
|fw1= |fw2= |bg1= |bg2= |ta1= |ta2=
 
}}
 
</pre>
 
  
 
===Parameters===
 
===Parameters===
Line 34: Line 13:
 
; style        : [[w:Cascading Style Sheets|CSS]] styling for template overall.
 
; style        : [[w:Cascading Style Sheets|CSS]] styling for template overall.
 
; headerstyle  : CSS styling for title (header).
 
; headerstyle  : CSS styling for title (header).
; contentstyle : CSS styling for the hidden content.
+
; contentstyle : any nonblank value (e.g. {{para|multline|y}}) will reduce the line-height of the title and add some padding to avoid overlap with the show/hide button.
; expanded    : any nonblank value (e.g. {{para|expanded|on}}) will cause the template to be initially expanded by default.
 
; multiline    : any nonblank value (e.g. {{para|multline|y}}) will reduce the line-height of the title and add some padding to avoid overlap with the show/hide button.
 
 
'''Note:''' This template will not respect the [[Wikipedia:User preferences|user preference]] "justify paragraphs".
 
'''Note:''' This template will not respect the [[Wikipedia:User preferences|user preference]] "justify paragraphs".
  
Line 45: Line 22:
 
{| class="wikitable"
 
{| class="wikitable"
 
| {{rh}} | Code
 
| {{rh}} | Code
| <pre>{{hidden|Title text here|Body text line 1<br/>Body text line 2}}</pre>
+
| <pre>{{Title text here|Body text line 1<br/>Body text line 2}}</pre>
 
|-
 
|-
 
| {{rh}} | Result
 
| {{rh}} | Result
Line 54: Line 31:
 
{| class="wikitable"
 
{| class="wikitable"
 
| {{rh}} | Code
 
| {{rh}} | Code
| <syntaxhighlight lang="css" style="overflow:auto;">
+
| <syntaxhighlight lang="css" style="overflow:auto;
{{hidden
 
 
|Title text here
 
|Title text here
 
|Body text line 1<br/>Body text line 2
 
|Body text line 1<br/>Body text line 2
Line 64: Line 40:
 
|-
 
|-
 
| {{rh}} | Result
 
| {{rh}} | Result
| {{{{PAGENAMETDOC}}|Title text here|Body text line 1<br/>Body text line 2|headerstyle=background:#ccccff|style=text-align:center;}}
+
|Title text here|Body text line 1<br/>Body text line 2|headerstyle=background:#ccccff|style=text-align:center;}}
|}
 
 
 
===CSS===
 
{| class="wikitable"
 
| {{rh}} | Code
 
|
 
<syntaxhighlight lang="css">
 
{{hidden
 
| style = border: 1px dashed red; width: 50%;
 
| headerstyle = background: #ccccff; font-size: 110%;
 
| contentstyle = text-align: center; color: green;
 
| header = Title text here
 
| content = Body text line 1<br />Body text line 2<br />Body text line 3
 
}}</syntaxhighlight>
 
|-
 
| {{rh}} | Result
 
|
 
{{{{PAGENAMETDOC}}
 
| style = border:1px dashed red; width: 50%;
 
| headerstyle = background: #ccccff; font-size: 110%;
 
| contentstyle = text-align: center; color:green;
 
| header = Title text here
 
| content = Body text line 1<br />Body text line 2<br />Body text line 3
 
}}
 
|}
 
  
 
== Issues ==
 
== Issues ==

Revision as of 14:27, 2 December 2020

}}</includeonly>