Jump to content

Template:Hidden: Difference between revisions

From pool
[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{hidden begin|collapsetext={{{collapsetext|}}}|expandtext={{{expandtext|}}}|toggle={{{showhide|}}}{{{toggle|}}}|expanded={{{expand|{{{expanded|}}}}}}|class={{{class|}}}|border={{{border|none}}}|style={{{style|{{{css|}}}}}}
{{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|}}}}}}}}}
|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}}}}}}}}}}}
|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|}}}}}} }}
|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>
<noinclude>


Line 28: Line 31:


====Optional====
====Optional====


; style : CSS styling for template overall.
; style : CSS styling for template overall.
; headerstyle : CSS styling for title (header).
; headerstyle : CSS styling for title (header).
Line 35: Line 40:
; toggle left : setting {{para|toggle|left}} will display "Expand" or "Collapse" at the left side of the page
; 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}})
; 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>
</br>
Line 52: Line 60:
| {{rh}} | Result
| {{rh}} | Result
| {{{{PAGENAMETDOC}}|Title text here|Body text line 1<br/>Body text line 2}}
| {{{{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 88: Line 106:
| {{{{PAGENAMETDOC}}|Title text here|Body text line 1<br/>Body text line 2|border=3px solid black|toggle=left|collapsetext="-"|expandtext="+"}}
| {{{{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===
===CSS===
Line 231: Line 275:
"description": "Text to replace \"Expand\" toggle",
"description": "Text to replace \"Expand\" toggle",
"example": "expandtext=\"+\"",
"example": "expandtext=\"+\"",
"type": "string"
},
"hlist": {
"description": "Formats content body as horizontal list",
"example": "hlist=true",
"type": "string"
"type": "string"
}
}

Latest revision as of 10:39, 8 December 2020

Header Text

Content Body Text


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=left will display "Expand" or "Collapse" at the left side of the page
border
any valid css for border styles (e.g. |border=6px solid red)
hlist
formats content text body as horizontal list (e.g. |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


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
Title text here

Body text line 1
Body text line 2

Alternative Display: In this example only the two required parameters are specified.

Code
{{Hidden|Title text here|Body text line 1<br/>Body text line 2|toggle=left|expandtext="+"|contentstyle = text-align: left|ta1 = left}}
Result
Title text here

Body text line 1
Body text line 2

Header background

Code
{{hidden
|Title text here
|Body text line 1<br/>Body text line 2
|headerstyle=background:#ccccff
|style=text-align:center;
}}
Result
Title text here

Body text line 1
Body text line 2


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
Title text here

Body text line 1
Body text line 2

Expanded by default using hlist

Code
{{hidden
|Horizontal List
|
*Bullet 1
*Bullet 2
*Bullet 3
|collapsetext="-"
|expandtext="+"
|expanded=on
|hlist=true
}}
Result
Horizontal List
  • Bullet 1
  • Bullet 2
  • Bullet 3


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
Title text here

Body text line 1
Body text line 2
Body text line 3


This hides

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Title1 title header

text for header (title)

Stringrequired
Body2

text for body (content)

Stringrequired
heading font weightfw1

The CSS font weight for the heading

Unknownoptional
heading background colorbg1

The CSS background color for the heading

Unknownsuggested
header body text alignta1

The CSS text align for the header

Unknownoptional
stylestyle css

CSS styling for template overall.

Unknownoptional
Header CSSheaderstyle headercss titlestyle titlecss

CSS styling for title (header)

Unknownoptional
Headerheader

text for header (title); alternative to using unnamed parameter {{{1}}}

Unknownoptional
Content CSScontentstyle contentcss

CSS styling for the hidden content

Stringoptional
Contentcontent contents text

text for body (content); alternative to using unnamed parameter {{{2}}}

Unknownoptional
heading font weightfw2

The CSS font weight for the heading

Unknownoptional
body background colorbg2

The CSS background color for the body

Unknownoptional
body text alignta2

The CSS text align for the body

Unknownoptional
toggletoggle showhide

Set toggle to left to show "Expand" on left side of page

Example
toggle=left
Stringoptional
expandedexpanded expand

any nonblank value will cause the template to be initially expanded by default.

Example
expanded=on
Unknownoptional
classclass

no description

Unknownoptional
borderborder

Change the CSS style border property

Example
border=6px solid red
Unknownoptional
multilinemultiline 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.

Example
multline=y
Unknownoptional
collapsetextcollapsetext

Text to replace "Collapse" toggle

Example
collapsetext="Hide"
Unknownoptional
expandtextexpandtext

Text to replace "Expand" toggle

Example
expandtext="+"
Stringoptional
hlisthlist

Formats content body as horizontal list

Example
hlist=true
Stringoptional