Difference between revisions of "Template:Hidden begin/doc"

From blackwiki
Jump to navigation Jump to search
imported>Sardanaphalus
(removed parent category)
imported>Gadget850
(add missing parameters; cleaned up)
Line 2: Line 2:
 
{{hatnote|This documentation is shared by {{tl|Hidden begin}} and {{tl|Hidden end}}.}}
 
{{hatnote|This documentation is shared by {{tl|Hidden begin}} and {{tl|Hidden end}}.}}
 
{{TOC limit|2}}
 
{{TOC limit|2}}
== Syntax ==
+
==Syntax==
  
 
<pre style="overflow:auto;">
 
<pre style="overflow:auto;">
Line 8: Line 8:
 
| expanded =  <!--"true", "on", yes", etc, otherwise omit-->
 
| expanded =  <!--"true", "on", yes", etc, otherwise omit-->
 
| showhide =  <!--"left", otherwise omit-->
 
| showhide =  <!--"left", otherwise omit-->
| border =  
+
| border =
| style =  
+
| style =
| titlestyle =  
+
| titlestyle =
| title =  
+
| title =
| contentstyle =  
+
| contentstyle =
 
<!--Older, semi-deprecated parameters:-->
 
<!--Older, semi-deprecated parameters:-->
 
|header= |bg1= |bg2= |ta1= |ta2= |extra1= |extra2=
 
|header= |bg1= |bg2= |ta1= |ta2= |extra1= |extra2=
Line 22: Line 22:
 
===Parameters===
 
===Parameters===
 
{| class="wikitable"
 
{| class="wikitable"
! Parameter    || Description  
+
! Parameter    || Description
 
|-
 
|-
| ''showhide''<!--previously: <br />or ''toggle''-->  || Set to "left" (without speechmarks) to switch the [show/hide] link's position from the righthand end of the titlebar (default) to the left.  
+
| ''showhide''<!--previously: <br />or ''toggle''-->  || Set to "left" (without speechmarks) to switch the [show/hide] link's position from the righthand end of the titlebar (default) to the left.
 
|-
 
|-
| ''expanded''  || Set to anything ("true", "yes", etc) to switch the hidden section's initial state from collapsed (hidden) to expanded (visible).  
+
| ''expanded''  || Set to anything ("true", "yes", etc) to switch the hidden section's initial state from collapsed (hidden) to expanded (visible).
 
|-
 
|-
 
| ''border''    || [[Cascading Style Sheets|CSS styling]] for border around entire area. Overridden by ''style'' (if used).
 
| ''border''    || [[Cascading Style Sheets|CSS styling]] for border around entire area. Overridden by ''style'' (if used).
Line 32: Line 32:
 
| ''style''    ||  CSS styling affecting entire area (titlebar and hidden/hideable content). Overrides ''border'' if used.
 
| ''style''    ||  CSS styling affecting entire area (titlebar and hidden/hideable content). Overrides ''border'' if used.
 
|-
 
|-
|style="vertical-align:top;"| ''titlestyle'' || CSS styles to apply to the titlebar (e.g. {{para|titlestyle|border:1px solid lightgrey;}} to produce a border around it; {{para|titlestyle|background:''color'';}} to set its background color to [[Web colors#X11 color names|''color'']]&thinsp;; {{para|titlestyle|text-align:[center/right];}} to switch its text (''title'')'s alignment from left to center or right; etc).  
+
|style="vertical-align:top;"| ''titlestyle'' || CSS styles to apply to the titlebar (e.g. {{para|titlestyle|border:1px solid lightgrey;}} to produce a border around it; {{para|titlestyle|background:''color'';}} to set its background color to [[Web colors#X11 color names|''color'']]&thinsp;; {{para|titlestyle|text-align:[center/right];}} to switch its text (''title'')'s alignment from left to center or right; etc).
 
|-
 
|-
| ''title''    || Text shown in titlebar.  
+
| ''title''    || Text shown in titlebar.
 
|-
 
|-
| ''contentstyle''&nbsp; || CSS styling to apply to the hidden material (e.g. background and text-align, per ''titlestyle'').  
+
| ''contentstyle''&nbsp; || CSS styling to apply to the hidden material (e.g. background and text-align, per ''titlestyle'').
 
|-
 
|-
 +
| ''header ||
 +
|-
 +
| bg1 ||
 +
|-
 +
| bg2 ||
 +
|-
 +
| ta1 ||
 +
|-
 +
| ta2 || text alignment of content; defautls to left
 +
|-
 +
| extra1 ||
 +
|-
 +
| extra2 ||
 
|}
 
|}
  
== Examples ==
+
==Examples==
 
===Example 1===
 
===Example 1===
 
<pre style="overflow:auto;">
 
<pre style="overflow:auto;">
 
{{Hidden begin |title=Default example}}
 
{{Hidden begin |title=Default example}}
*def
+
* def
*ghi
+
* ghi
 
{{Hidden end}}
 
{{Hidden end}}
 
</pre>
 
</pre>
 
{{Hidden begin{{#ifeq:{{SUBPAGENAME}}|sandbox |/sandbox}} |title=Default example}}
 
{{Hidden begin{{#ifeq:{{SUBPAGENAME}}|sandbox |/sandbox}} |title=Default example}}
*def
+
* def
*ghi
+
* ghi
 
{{Hidden end}}
 
{{Hidden end}}
  
Line 59: Line 72:
 
| title = ''titlestyle'' is "background:pink;"
 
| title = ''titlestyle'' is "background:pink;"
 
}}
 
}}
*def
+
* def
*ghi
+
* ghi
 
{{Hidden end}}
 
{{Hidden end}}
 
</pre>
 
</pre>
Line 67: Line 80:
 
| title = ''titlestyle'' is "background:pink;"
 
| title = ''titlestyle'' is "background:pink;"
 
}}
 
}}
*def
+
* def
*ghi
+
* ghi
 
{{Hidden end}}
 
{{Hidden end}}
  
Line 77: Line 90:
 
| title = added "text-align:center;"
 
| title = added "text-align:center;"
 
}}
 
}}
*def
+
* def
*ghi
+
* ghi
 
{{Hidden end}}
 
{{Hidden end}}
 
</pre>
 
</pre>
Line 85: Line 98:
 
| title = added "text-align:center;"
 
| title = added "text-align:center;"
 
}}
 
}}
*def
+
* def
*ghi
+
* ghi
 
{{Hidden end}}
 
{{Hidden end}}
  
Line 95: Line 108:
 
| title = ''title'' on right with 3.0em padding
 
| title = ''title'' on right with 3.0em padding
 
}}
 
}}
*change window width and
+
* change window width and
*watch title alignment
+
* watch title alignment
 
{{Hidden end}}
 
{{Hidden end}}
 
</pre>
 
</pre>
Line 103: Line 116:
 
| title = ''title'' on right with 3.0em padding
 
| title = ''title'' on right with 3.0em padding
 
}}
 
}}
*change window width and
+
* change window width and
*watch title alignment
+
* watch title alignment
 
{{Hidden end}}
 
{{Hidden end}}
  
Line 113: Line 126:
 
| title = ''showhide'' set to "left"
 
| title = ''showhide'' set to "left"
 
}}
 
}}
*def
+
* def
*ghi
+
* ghi
 
{{Hidden end}}
 
{{Hidden end}}
 
</pre>
 
</pre>
Line 121: Line 134:
 
| title = ''showhide'' set to "left"
 
| title = ''showhide'' set to "left"
 
}}
 
}}
*def
+
* def
*ghi
+
* ghi
 
{{Hidden end}}
 
{{Hidden end}}
  
Line 130: Line 143:
 
| titlestyle = background:palegreen;
 
| titlestyle = background:palegreen;
 
| title = <code style="background:transparent;">showhide=left</code>, hidden content 150% size and in bold (''contentstyle'')
 
| title = <code style="background:transparent;">showhide=left</code>, hidden content 150% size and in bold (''contentstyle'')
| contentstyle = font-size:150%; font-weight:bold;  
+
| contentstyle = font-size:150%; font-weight:bold;
 
}}
 
}}
*def
+
* def
*ghi
+
* ghi
 
{{Hidden end}}
 
{{Hidden end}}
 
</pre>
 
</pre>
Line 139: Line 152:
 
| titlestyle = background:palegreen;
 
| titlestyle = background:palegreen;
 
| title = <code style="background:transparent;">showhide=left</code>, hidden content 150% size and in bold (''contentstyle'')
 
| title = <code style="background:transparent;">showhide=left</code>, hidden content 150% size and in bold (''contentstyle'')
| contentstyle = font-size:150%; font-weight:bold;  
+
| contentstyle = font-size:150%; font-weight:bold;
 
}}
 
}}
*def
+
* def
*ghi
+
* ghi
 
{{Hidden end}}
 
{{Hidden end}}
  
Line 159: Line 172:
 
| extra2 = font-size:150%
 
| extra2 = font-size:150%
 
}}
 
}}
*make window narrower and
+
* make window narrower and
*title will wrap
+
* title will wrap
 
{{Hidden end}}
 
{{Hidden end}}
 
</pre>
 
</pre>
Line 175: Line 188:
 
| extra2 = font-size:150%
 
| extra2 = font-size:150%
 
}}
 
}}
*make window narrower and
+
* make window narrower and
*title will wrap
+
* title will wrap
 
{{Hidden end}}
 
{{Hidden end}}
  
Line 182: Line 195:
 
<pre style="overflow:auto;">
 
<pre style="overflow:auto;">
 
{{Hidden begin
 
{{Hidden begin
| titlestyle =  
+
| titlestyle =
 
| title = title&amp;nbsp;with&amp;nbsp;non-breaking&amp;nbsp;spaces&amp;nbsp;
 
| title = title&amp;nbsp;with&amp;nbsp;non-breaking&amp;nbsp;spaces&amp;nbsp;
 
| border = 1px solid red
 
| border = 1px solid red
Line 192: Line 205:
 
| extra2 = font-size:150%; padding-left:3.0em;
 
| extra2 = font-size:150%; padding-left:3.0em;
 
}}
 
}}
*def ... these should have left padding
+
* def ... these should have left padding
*ghi
+
* ghi
 
{{Hidden end}}
 
{{Hidden end}}
 
</pre>
 
</pre>
 
{{Hidden begin{{#ifeq:{{SUBPAGENAME}}|sandbox |/sandbox}}
 
{{Hidden begin{{#ifeq:{{SUBPAGENAME}}|sandbox |/sandbox}}
| titlestyle =  
+
| titlestyle =
 
| title = title&nbsp;with&nbsp;non-breaking&nbsp;spaces&nbsp;
 
| title = title&nbsp;with&nbsp;non-breaking&nbsp;spaces&nbsp;
 
| border = 1px solid red
 
| border = 1px solid red
Line 207: Line 220:
 
| extra2 = font-size:150%; padding-left:3.0em;
 
| extra2 = font-size:150%; padding-left:3.0em;
 
}}
 
}}
*def ... these should have left padding
+
* def ... these should have left padding
*ghi
+
* ghi
 
{{Hidden end}}
 
{{Hidden end}}
  
== See also ==
+
==See also==
 
* {{tl|Hidden}}
 
* {{tl|Hidden}}
  

Revision as of 15:37, 14 March 2015

Syntax

{{Hidden begin
| expanded =  <!--"true", "on", yes", etc, otherwise omit-->
| showhide =  <!--"left", otherwise omit-->
| border =
| style =
| titlestyle =
| title =
| contentstyle =
<!--Older, semi-deprecated parameters:-->
|header= |bg1= |bg2= |ta1= |ta2= |extra1= |extra2=
}}
<!----[content to be hidden placed here]---->
{{Hidden end}}

Parameters

Parameter Description
showhide Set to "left" (without speechmarks) to switch the [show/hide] link's position from the righthand end of the titlebar (default) to the left.
expanded Set to anything ("true", "yes", etc) to switch the hidden section's initial state from collapsed (hidden) to expanded (visible).
border CSS styling for border around entire area. Overridden by style (if used).
style CSS styling affecting entire area (titlebar and hidden/hideable content). Overrides border if used.
titlestyle CSS styles to apply to the titlebar (e.g. |titlestyle=border:1px solid lightgrey; to produce a border around it; |titlestyle=background:color; to set its background color to color ; |titlestyle=text-align:[center/right]; to switch its text (title)'s alignment from left to center or right; etc).
title Text shown in titlebar.
contentstyle  CSS styling to apply to the hidden material (e.g. background and text-align, per titlestyle).
header
bg1
bg2
ta1
ta2 text alignment of content; defautls to left
extra1
extra2

Examples

Example 1

{{Hidden begin |title=Default example}}
* def
* ghi
{{Hidden end}}
Default example
  • def
  • ghi

Example 2

{{Hidden begin
| titlestyle = background:pink;
| title = ''titlestyle'' is "background:pink;"
}}
* def
* ghi
{{Hidden end}}
titlestyle is "background:pink;"
  • def
  • ghi

Example 3

{{Hidden begin
| titlestyle = background:pink; text-align:center;
| title = added "text-align:center;"
}}
* def
* ghi
{{Hidden end}}
added "text-align:center;"
  • def
  • ghi

Example 4

{{Hidden begin
| titlestyle = background:pink; text-align:right; padding-right:3.0em;
| title = ''title'' on right with 3.0em padding
}}
* change window width and
* watch title alignment
{{Hidden end}}
title on right with 3.0em padding
  • change window width and
  • watch title alignment

Example 5

{{Hidden begin |showhide=left
| titlestyle = background:palegreen;
| title = ''showhide'' set to "left"
}}
* def
* ghi
{{Hidden end}}
showhide set to "left"
  • def
  • ghi

Example 6

{{Hidden begin |showhide=left
| titlestyle = background:palegreen;
| title = <code style="background:transparent;">showhide=left</code>, hidden content 150% size and in bold (''contentstyle'')
| contentstyle = font-size:150%; font-weight:bold;
}}
* def
* ghi
{{Hidden end}}
showhide=left, hidden content 150% size and in bold (contentstyle)
  • def
  • ghi

Example 7

{{Hidden begin
| header = [''header'' (deprecated)]
| titlestyle = font-style:italic; padding-right:3.0em;
| title = [''title'' set to this text]
| border = 1px solid grey
| bg1 = palegreen
| bg2 = cyan
| ta1 = left
| ta2 = center
| extra1 = font-size:120%
| extra2 = font-size:150%
}}
* make window narrower and
* title will wrap
{{Hidden end}}
[header (deprecated)][title set to this text]
  • make window narrower and
  • title will wrap

Example 8

{{Hidden begin
| titlestyle =
| title = title&nbsp;with&nbsp;non-breaking&nbsp;spaces&nbsp;
| border = 1px solid red
| bg1 = cyan
| bg2 = yellow
| ta1 = right
| ta2 = left
| extra1 = font-size:120%; padding-right:2.5em;
| extra2 = font-size:150%; padding-left:3.0em;
}}
* def ... these should have left padding
* ghi
{{Hidden end}}
title with non-breaking spaces 
  • def ... these should have left padding
  • ghi

See also