Template:Divhide: Difference between revisions

restored title to an unnamed and optional parameter to match the usage of this template throughout the wiki
(+docs; all right, I think my work is done here)
(restored title to an unnamed and optional parameter to match the usage of this template throughout the wiki)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#ifeq:{{{1}}}|end|</div></div>|
<includeonly><templatestyles src="Template:Divhide/styles.css"/>{{
<div class="NavFrame {{#ifeq:{{{show}}}|yes||collapsed}}" {{#if:{{{2|}}}|style="width:{{{2}}}"}}><div class="NavHead" style="background-color:{{{color|#A7D7F9}}}">{{{1}}}</div><div class="NavContent" style="text-align:left;">
#ifeq:{{lc:{{{1}}}}}
}}</includeonly><noinclude>This template produces cute little boxes to hide text in. You simply place <nowiki>{{divhide|optional title}}</nowiki> at the start of the text you want to hide, and <nowiki>{{divhide|end}}</nowiki> at the end, and everything in-between folds up nice and neat. You can choose the initial state of the box by using the parameter '''show'''; if it is set to "yes", the box will be open when the page loads; otherwise it will be collapsed initially. You can also pass in the '''color''' parameter to set the background color.
|end
{{Divhide|Look at me, I'm cute!|color=#FFFF80}}<center>ʘ‿ʘ</center>{{Divhide|end}}
|</div></div>
|<div class="hidden-begin mw-collapsible {{#ifeq:{{{show}}}|yes||mw-collapsed}}" style="{{#if:{{{bgcolor|}}}|background-color:{{{bgcolor}}};}}"><!--
--><div class="hidden-title skin-nightmode-reset-color" style="text-align:center; background-color:{{{titlebgcolor|#A7D7F9}}};">{{{1|&nbsp;}}}</div><!--
--><div class="hidden-content mw-collapsible-content" style="{{#if:{{{contentbgcolor|}}}|background-color:{{{contentbgcolor}}};}}">
}}</includeonly><noinclude>
This template produces cute little boxes to hide text in. You simply place <tt><nowiki>{{Divhide|some title}}</nowiki></tt> at the start of the text you want to hide, and <tt><nowiki>{{Divhide|end}}</nowiki></tt> at the end, and everything in-between folds up nice and neat. Additional optional parameters:


{{Divhide|(open to see markup for above)}}<nowiki>{{Divhide|Look at me, I'm cute!|color=#FFFF80}}<center>ʘ‿ʘ</center>{{Divhide|end}}</nowiki>{{Divhide|end}}
*'''show''': Sets the initial state of the box; if it is set to "yes", the box will be open when the page loads, otherwise it will be collapsed initially.
[[Category:Basic formatting templates]]</noinclude>
*'''bgcolor''': Sets the background color of the entire box.
*'''titlebgcolor''', '''contentbgcolor''': Exactly what you'd guess these are.
 
Example:
{{Divhide|Look at me, I'm cute!|titlebgcolor=#FFFF80}}<center>ʘ‿ʘ</center>{{Divhide|end}}
 
{{Divhide|(open to see markup for above)}}<nowiki>{{Divhide|Look at me, I'm cute!|titlebgcolor=#FFFF80}}<center>ʘ‿ʘ</center>{{Divhide|end}}</nowiki>{{Divhide|end}}
 
[[Category:Message box templates]]</noinclude>