Template:Hidden: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
 
(15 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>}}}}}}}}}}}}
</div> | {{{content|{{{contents|{{{text|{{{2|<noinclude>Content Body Text</noinclude>}}}}}}}}}}}} }}
</div></div>{{hidden end}}
<noinclude>
 
Line 28 ⟶ 31:
 
====Optional====
 
; style : [[w:Cascading Style Sheets|CSS]] styling for template overall.
 
; 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 ==
Line 45 ⟶ 60:
| {{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}}
|}
 
Line 62 ⟶ 87:
| {{{{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===
Line 86 ⟶ 156:
}}
|}
 
</br>
 
 
Line 109 ⟶ 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": [
Line 147 ⟶ 229:
]
},
"fw2": {},
"bg2label": {}"heading font weight",
"description": "The CSS font weight for the heading"
"ta2": {},
},
"bg2": {
"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": [
Line 166 ⟶ 257:
},
"class": {},
"border": {},
"description": "Change the CSS style border property",
"example": "border=6px solid red"
},
"multiline": {
"aliases": [
Line 181 ⟶ 275:
"description": "Text to replace \"Expand\" toggle",
"example": "expandtext=\"+\"",
"type": "string"
},
"hlist": {
"description": "Formats content body as horizontal list",
"example": "hlist=true",
"type": "string"
}