Template:Hidden: Difference between revisions
| [unchecked revision] | [unchecked revision] |
Caleb Cooper (talk | contribs) No edit summary |
Caleb Cooper (talk | contribs) No edit summary |
||
| Line 33: | Line 33: | ||
; expanded : any nonblank value (e.g. {{para|expanded|on}}) will cause the template to be initially expanded by default. |
; 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. |
; 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}}) |
|||
</br> |
|||
'''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". |
||
</br> |
|||
== Examples == |
== Examples == |
||
| Line 61: | Line 68: | ||
| {{rh}} | Result |
| {{rh}} | Result |
||
| {{{{PAGENAMETDOC}}|Title text here|Body text line 1<br/>Body text line 2|headerstyle=background:#ccccff|style=text-align:center;}} |
| {{{{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="+"}} |
|||
|} |
|} |
||
| Line 86: | Line 112: | ||
}} |
}} |
||
|} |
|} |
||
</br> |
|||
| Line 111: | Line 139: | ||
"fw1": { |
"fw1": { |
||
"label": "heading font weight", |
"label": "heading font weight", |
||
"description": "The CSS font weight for the heading |
"description": "The CSS font weight for the heading" |
||
}, |
}, |
||
"bg1": { |
"bg1": { |
||
"label": "heading background color", |
"label": "heading background color", |
||
"description": "The CSS background color for the heading |
"description": "The CSS background color for the heading", |
||
"suggested": true |
"suggested": true |
||
}, |
}, |
||
"ta1": { |
"ta1": { |
||
"label": "header body text align", |
"label": "header body text align", |
||
"description": "The CSS text align for the header |
"description": "The CSS text align for the header" |
||
}, |
}, |
||
"style": { |
"style": { |
||
| Line 159: | Line 187: | ||
"fw2": { |
"fw2": { |
||
"label": "heading font weight", |
"label": "heading font weight", |
||
"description": "The CSS font weight for the heading |
"description": "The CSS font weight for the heading" |
||
}, |
}, |
||
"bg2": { |
"bg2": { |
||
"label": "body background color", |
"label": "body background color", |
||
"description": "The CSS background color for the body |
"description": "The CSS background color for the body" |
||
}, |
}, |
||
"ta2": { |
"ta2": { |
||
"label": "body text align", |
"label": "body text align", |
||
"description": "The CSS text align for the body |
"description": "The CSS text align for the body" |
||
}, |
}, |
||
"toggle": { |
"toggle": { |
||
| Line 185: | Line 213: | ||
}, |
}, |
||
"class": {}, |
"class": {}, |
||
"border": { |
"border": { |
||
"description": "Change the CSS style border property", |
|||
"example": "border=6px solid red" |
|||
}, |
|||
"multiline": { |
"multiline": { |
||
"aliases": [ |
"aliases": [ |
||
Revision as of 15:29, 2 July 2020
Usage
Full syntax
{{Hidden
| expanded=true <!--(omit for initial hidden state)-->
| style =
| headerstyle =
| header =
| contentstyle =
| content =
|fw1= |fw2= |bg1= |bg2= |ta1= |ta2=
}}
Parameters
Only two parameters are required for this template:
- header
- text for header (title); alternative to using unnamed parameter {{{1}}}
- content
- text for body (content); alternative to using unnamed parameter {{{2}}}
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.
|expanded=on) will cause the template to be initially expanded by default. - multiline
- any nonblank value (e.g.
|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
|toggle=leftwill display "Expand" or "Collapse" at the left side of the page - border
- any valid css for border styles (e.g.
|border=6px solid red)
Note: This template will not respect the user preference "justify paragraphs".
Examples
Basic
In this example only the two required parameters are specified.
| Code | {{hidden|Title text here|Body text line 1<br/>Body text line 2}}
|
| Result |
Header background
| Code | {{hidden
|Title text here
|Body text line 1<br/>Body text line 2
|headerstyle=background:#ccccff
|style=text-align:center;
}}
|
| Result |
Border with toggle left
| Code | {{hidden
|Title text here
|Body text line 1<br/>Body text line 2
|border=3px solid black
|toggle=left
|collapsetext="-"
|expandtext="+"
}}
|
| Result |
CSS
| Code |
{{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
}}
|
| Result |
This hides
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Title | 1 title header | text for header (title) | String | required |
| Body | 2 | text for body (content) | String | required |
| heading font weight | fw1 | The CSS font weight for the heading | Unknown | optional |
| heading background color | bg1 | The CSS background color for the heading | Unknown | suggested |
| header body text align | ta1 | The CSS text align for the header | Unknown | optional |
| style | style css | CSS styling for template overall. | Unknown | optional |
| Header CSS | headerstyle headercss titlestyle titlecss | CSS styling for title (header) | Unknown | optional |
| Header | header | text for header (title); alternative to using unnamed parameter {{{1}}} | Unknown | optional |
| Content CSS | contentstyle contentcss | CSS styling for the hidden content | String | optional |
| Content | content contents text | text for body (content); alternative to using unnamed parameter {{{2}}} | Unknown | optional |
| heading font weight | fw2 | The CSS font weight for the heading | Unknown | optional |
| body background color | bg2 | The CSS background color for the body | Unknown | optional |
| body text align | ta2 | The CSS text align for the body | Unknown | optional |
| toggle | toggle showhide | Set toggle to left to show "Expand" on left side of page
| String | optional |
| expanded | expanded expand | any nonblank value will cause the template to be initially expanded by default.
| Unknown | optional |
| class | class | no description | Unknown | optional |
| border | border | Change the CSS style border property
| Unknown | optional |
| multiline | multiline multi-line | any nonblank value will reduce the line-height of the title and add some padding to avoid overlap with the show/hide button.
| Unknown | optional |
| collapsetext | collapsetext | Text to replace "Collapse" toggle
| Unknown | optional |
| expandtext | expandtext | Text to replace "Expand" toggle
| String | optional |