Template:Hidden: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
 
(22 intermediate revisions by 2 users not shown)
Line 1:
{{hidden begin|collapsetext={{{collapsetext|}}}|expandtext={{{expandtext|}}}|toggle={{{showhide|}}}{{{toggle|}}}|expanded={{{expand|{{{expanded|}}}}}}|class={{{class|}}}|border={{{border|none}}}|style={{{style|{{{css|}}}}}}
|bg1={{{bg1|transparent}}}|ta1={{{ta1|center}}}|titlestyle={{#if:{{{multiline|{{{multi-line|}}}}}}|height:auto;}}{{#ifeq:{{{fw1|bold}}}|bold||font-weight:{{{fw1|bold}}};}}{{{headercss|{{{headerstyle|{{{titlestyle|}}}}}}}}}
|title={{#if:{{{multiline|{{{multi-line|}}}}}}|<div style="margin-right:4em;line-height:125%;height:auto;">{{{title|{{{header|{{{1}}}}}}}}}</div>|{{{title|{{{header|{{{1|<noinclude>Header Text</noinclude>}}}}}}}}}}}
|bg2={{{bg2|transparent}}}|ta2={{{ta2|left}}}|contentstyle={{#ifeq:{{{fw2|normal}}}|normal||font-weight:{{{fw2|normal}}};}}{{{contentcss|{{{contentstyle|}}}}}} }}
{{#ifeq: {{{hlist|}}} | true |<div class="hlist">
{{{content|{{{contents|{{{text|{{{2}}}}}}}}}}}}{{hidden end}}{{#if:{{{bg1|}}}{{{bg2|}}}{{{ta1|}}}{{{ta2|}}}{{{fw1|}}}{{{fw2|}}}|[[Category:Hidden templates using styles|{{NAMESPACE}}{{PAGENAME}}]]}}
{{{content|{{{contents|{{{text|{{{2|<noinclude>Content Body Text</noinclude>}}}}}}}}}}}}
<noinclude>Content that should not be hidden.[[Category:Templates]]
</div> | {{{content|{{{contents|{{{text|{{{2|<noinclude>Content Body Text</noinclude>}}}}}}}}}}}} }}
</div></div>{{hidden end}}
<noinclude>
 
== 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===
Only two parameters are required for this template:
; header : text for header (title); alternative to using unnamed parameter <nowiki>{{{1}}}</nowiki>
; content : text for body (content); alternative to using unnamed parameter <nowiki>{{{2}}}</nowiki>
 
====Optional====
 
 
; style : CSS styling for template overall.
; headerstyle : CSS styling for title (header).
; contentstyle : CSS styling for the hidden content.
; 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.
; toggle left : setting {{para|toggle|left}} will display "Expand" or "Collapse" at the left side of the page
; border : any valid css for border styles (e.g. {{para|border|6px solid red}})
; hlist : formats content text body as horizontal list (e.g. {{para|hlist|true}})
 
{{Note|There are many additional parameters added for backwards compatibility with Templates copied from mediawiki or wikipedia, see template data below for full list}}
 
</br>
 
'''Note:''' This template will not respect the [[Wikipedia:User preferences|user preference]] "justify paragraphs".
 
</br>
 
== Examples ==
 
===Basic===
In this example only the two required parameters are specified.
{| class="wikitable"
| {{rh}} | Code
| <pre>{{hidden|Title text here|Body text line 1<br/>Body text line 2}}</pre>
|-
| {{rh}} | Result
| {{{{PAGENAMETDOC}}|Title text here|Body text line 1<br/>Body text line 2}}
|}
 
Alternative Display:
In this example only the two required parameters are specified.
{| class="wikitable"
| {{rh}} | Code
| <pre>{{Hidden|Title text here|Body text line 1<br/>Body text line 2|toggle=left|expandtext="+"|contentstyle = text-align: left|ta1 = left}}</pre>
|-
| {{rh}} | Result
| {{{{PAGENAMETDOC}}|Title text here|Body text line 1<br/>Body text line 2|toggle=left|expandtext="+"|contentstyle = text-align: left|ta1 = left}}
|}
 
===Header background===
{| class="wikitable"
| {{rh}} | Code
| <source lang="css" style="overflow:auto;">
{{hidden
|Title text here
|Body text line 1<br/>Body text line 2
|headerstyle=background:#ccccff
|style=text-align:center;
}}
</source>
|-
| {{rh}} | Result
| {{{{PAGENAMETDOC}}|Title text here|Body text line 1<br/>Body text line 2|headerstyle=background:#ccccff|style=text-align:center;}}
|}
 
 
===Border with toggle left===
{| class="wikitable"
| {{rh}} | Code
| <source lang="css" style="overflow:auto;">
{{hidden
|Title text here
|Body text line 1<br/>Body text line 2
|border=3px solid black
|toggle=left
|collapsetext="-"
|expandtext="+"
}}
</source>
|-
| {{rh}} | Result
| {{{{PAGENAMETDOC}}|Title text here|Body text line 1<br/>Body text line 2|border=3px solid black|toggle=left|collapsetext="-"|expandtext="+"}}
|}
 
=== Expanded by default using hlist ===
{| class="wikitable"
| {{rh}} | Code
| <source lang="css" style="overflow:auto;">
{{hidden
|Horizontal List
|
*Bullet 1
*Bullet 2
*Bullet 3
|collapsetext="-"
|expandtext="+"
|expanded=on
|hlist=true
}}
</source>
|-
| {{rh}} | Result
| {{{{PAGENAMETDOC}}|Horizontal List|
*Bullet 1
*Bullet 2
*Bullet 3
|collapsetext="-"|expandtext="+"|expanded=on|hlist=true}}
|}
 
 
===CSS===
{| class="wikitable"
| {{rh}} | Code
|
<source 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
}}</source>
|-
| {{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
}}
|}
 
</br>
 
 
[[Category:Templates]]
<templatedata>
{
Line 25 ⟶ 181:
"required": true
},
"fw1": {},
"bg1label": {}"heading font weight",
"description": "The CSS font weight for the heading"
"ta1": {},
},
"bg1": {
"label": "heading background color",
"description": "The CSS background color for the heading",
"suggested": true
},
"ta1": {
"label": "header body text align",
"description": "The CSS text align for the header"
},
"style": {
"aliases": [
"css"
],
"description": "CSS styling for template overall."
},
"headerstyle": {
"label": "Header CSS",
"description": "CSS styling for title (header)",
"aliases": [
"headercss",
"titlestyle",
"titlecss"
]
},
Line 39 ⟶ 213:
"description": "text for header (title); alternative to using unnamed parameter {{{1}}}"
},
"content": {
"label": "Content",
"description": "text for body (content); alternative to using unnamed parameter {{{2}}}"
},
"fw2": {},
"bg2": {},
"ta2": {},
"showhide": {},
"toggle": {},
"expand": {},
"expanded": {},
"class": {},
"border": {},
"multiline": {},
"multi-line": {},
"titlestyle": {},
"contentstyle": {
"aliases": [
Line 63 ⟶ 221:
"type": "string"
},
"contentscontent": {
"label": "Content",
"description": "text for body (content); alternative to using unnamed parameter {{{2}}}"
"description": "text for body (content); alternative to using unnamed parameter {{{2}}}",
"aliases": [
"contents",
"text"
]
},
"textfw2": {
"label": "heading font weight",
"description": "text for body (content); alternative to using unnamed parameter {{{2}}}"
"description": "The CSS font weight for the heading"
},
"stylebg2": {
"label": "body background color",
"description": "The CSS background color for the body"
},
"ta2": {
"label": "body text align",
"description": "The CSS text align for the body"
},
"toggle": {
"aliases": [
"cssshowhide"
],
"description": "CSSSet stylingtoggle forto templateleft overall.to show \"Expand\" on left side of page",
"example": "toggle=left",
"type": "string"
},
"expanded": {
"aliases": [
"expand"
],
"description": "any nonblank value will cause the template to be initially expanded by default.",
"example": "expanded=on"
},
"class": {},
"border": {
"description": "Change the CSS style border property",
"example": "border=6px solid red"
},
"multiline": {
"aliases": [
"multi-line"
],
"description": "any nonblank value will reduce the line-height of the title and add some padding to avoid overlap with the show/hide button.",
"example": "multline=y"
},
"collapsetext": {
"description": "Text to replace \"Collapse\" toggle",
"example": "collapsetext=\"Hide\""
},
"expandtext": {
"description": "Text to replace \"Expand\" toggle",
"example": "expandtext=\"+\"",
"type": "string"
},
"hlist": {
"description": "Formats content body as horizontal list",
"example": "hlist=true",
"type": "string"
}
}