Template:ExpandBox: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(experimenting with scripting for an expandable box. ignore this for now please.)
 
No edit summary
 
(40 intermediate revisions by 8 users not shown)
Line 1: Line 1:
[http://javascript:$('#firstHeading').css({'background-color':'red','color':'white','font-size':'44px'}); jstest]
{{LanguageBar}}
<div style="border:1px grey solid; height:7em; overflow:hidden;">What does that term encompass?
{{Note|It is recommended that you use [[Template:Expand]] instead, but for certain pages, this template will be (temporarily?) kept since it works better with some templates.}}
What does that term encompass?
<includeonly><onlyinclude><!--
What does that term encompass?
 
What does that term encompass?
-->
What does that term encompass?
<div class="mw-collapsible {{#ifeq:{{{startcollapsed|1}}}|0||mw-collapsed}}" data-expandtext="{{{expandtext|Expand}}}" data-collapsetext="{{{collapsetext|Collapse}}}" style="border:1px rgba(255,255,255,0.2) solid; overflow:auto; float:{{{side|none}}}; display: table-cell; {{{style|}}}"><!--
What does that term encompass?
--><strong>{{{title|{{{2|}}}}}}{{#if:{{{title|}}}{{{2|}}}|&nbsp;|<br>}}</strong><!--
What does that term encompass?
--><div class="mw-collapsible-content" style="max-width:83em; padding:0 0.5em"><!--
What does that term encompass?
-->{{{1}}}<!--
What does that term encompass?
--></div></div><!--
What does that term encompass?
 
What does that term encompass?
--></onlyinclude></includeonly>
What does that term encompass?
{{doc}}
What does that term encompass?
<!-- Add categories to the /doc subpage, not here -->
What does that term encompass?
What does that term encompass?
What does that term encompass?
What does that term encompass?
What does that term encompass?
What does that term encompass?
What does that term encompass?
What does that term encompass?
What does that term encompass?
What does that term encompass?
What does that term encompass?
What does that term encompass?
What does that term encompass?
What does that term encompass?
</div><div style="position: relative; bottom: 4em; height: 4em; background: -webkit-linear-gradient( rgba(255, 255, 255, 0) 0%, rgba(38, 38, 38, 1) 100%);"></div>

Latest revision as of 03:49, 11 February 2025

Flag-white.pngEnglish (en)
Note.pngNote:It is recommended that you use Template:Expand instead, but for certain pages, this template will be (temporarily?) kept since it works better with some templates.
English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
View
Page history

This template is intended for very long lists that aren't significant enough to warrant their own page, but also end up making pages ridiculously long. Works fine even if used multiple times on a page. (Also, won't interfere with TOCs.)

Parameters

  • {{{1}}} - The content that should be collapsible.
  • {{{title}}} - The headline text of the ExpandBox.
  • {{{side}}} - Where this ExpandBox should float, i.e. "left" or "right". Does not float by default. If it floats, one can use {{clr}} to clear vertical space.
  • {{{expandtext}}} - The text that must be clicked to show {{{1}}}. Default is "Expand".
  • {{{collapsetext}}} - The text that must be clicked to hide {{{1}}}. Default is "Collapse".
  • {{{startcollapsed}}} - If set to 0, the content is initially visible, otherwise collapsed. Default is 1.
  • {{{style}}} - Additional style parameters for the outer <div>.

Examples

Wikitext Result
Previous text.
{{ExpandBox |
* Sample
* Enumeration
* Worth
* Hiding
}}
Subsequent text.
Previous text.

  • Sample
  • Enumeration
  • Worth
  • Hiding

Subsequent text.

Previous text.
{{ExpandBox
|startcollapsed=0
|
* Sample
* Enumeration
* Worth
* Hiding
}}
Subsequent text.
Previous text.

  • Sample
  • Enumeration
  • Worth
  • Hiding

Subsequent text.

Previous text.
{{ExpandBox
|expandtext=Show
|collapsetext=Hide
|
* Sample
* Enumeration
* Worth
* Hiding
}}
Subsequent text.
Previous text.

  • Sample
  • Enumeration
  • Worth
  • Hiding

Subsequent text.

Previous text.
{{ExpandBox
|side=right
|
* Sample
* Enumeration
* Worth
* Hiding
}}
Subsequent text.
Previous text.

  • Sample
  • Enumeration
  • Worth
  • Hiding

Subsequent text.

Previous text.
{{ExpandBox
|title=Example for an ExpandBox
|
* Sample
* Enumeration
* Worth
* Hiding
}}
Subsequent text.
Previous text.
Example for an ExpandBox 
  • Sample
  • Enumeration
  • Worth
  • Hiding

Subsequent text.