|
<includeonly><{{#ifeq:{{{inline|}}}|yes|span|div}} class="mw-collapsible {{#ifeq:{{lc:{{{state|collapsed}}}}}|expanded||mw-collapsed}}" id="mw-customcollapsible-{{{#ifeqid|1}}}" style="display:inline; {{{compactstyle|}}}|yes|mw-compact-toggle|}}">
< {{#ifeq:{{{inline|}}}|yes|span |div}} class="mw-collapsible-content" style=" {{#ifeq:{{{inline|}}}|yes|display:inline; }}"> ▼
data-expandtext="{{{expandtext|more ▾}}}"
{{{text|}}}<span class="mw-customtoggle-{{{id|1}}}" style="cursor:pointer; color:#0645ad; margin-left:0.5em; vertical-align:baseline; display:inline;">{{{collapsetext|less ▴}}}</span>
data-collapsetext="{{{collapsetext|less ▴}}}"
style="{{#ifeq:{{{inline|}}}|yes|display:inline;}}{{#ifeq:{{{compact|}}}|yes|display:inline-block; vertical-align:top;}} {{{style|}}}">
</span><span class="mw-customtoggle-{{{id|1}}} mw-collapsible {{#ifeq:{{lc:{{{state|collapsed}}}}}|expanded|mw-collapsed|}}" id="mw-customcollapsible-{{{id|1}}}-btn" style="cursor:pointer; color:#0645ad; margin-left:0.5em; vertical-align:baseline; display:inline-block;">{{{expandtext|more ▾}}}</span></includeonly><noinclude>
▲<{{#ifeq:{{{inline|}}}|yes|span|div}} class="mw-collapsible-content" style="{{#ifeq:{{{inline|}}}|yes|display:inline;}}">
{{{text|}}}</{{#ifeq:{{{inline|}}}|yes|span|div}}>
</{{#ifeq:{{{inline|}}}|yes|span|div}}></includeonly><noinclude>
== Usage ==
To ensure the buttons "glue" to the end of the text, you must provide a unique '''id''' if using this more than once on a single page.
Standard block usage (floats toggle to the far right):
<pre>
{{show
|text=The primary driver for the acquisition was the target's proprietary AI technology.
}}
== Compact Usage ==
This version prevents the "jump" and keeps the link next to the text.
<pre>
{{show
|id=bio1
|compact=yes
|text=This is a very long text isthat shortwill andspan multiple lines. When it expands, the "less" button stayswill closestay andright here at the alignedend.
}}
</pre>
== Parameters ==
* '''id''': (Required if multiple on one page) A unique name like "1", "2", "bio", etc.
* '''text''': The content to be hidden/shown.
* '''expandtexttext''': The text for the "show" link (Defaults to "more ▾")content.
* '''collapsetextexpandtext''': The text for the "hide" link (Defaults to "lessmore ▴▾").
* '''inlinecollapsetext''': SetDefaults to "yesless ▴" to use span tags.
* '''compactstate''': Set to "yesexpanded" to keepshow theby toggle link next to the text and fix the "push down" alignment issuedefault.
* '''state''': Set to "expanded" to have the text visible on page load.
* '''style''': Pass additional CSS styles directly.
== Required CSS ==
Add this to your [[MediaWiki:Common.css]] to ensure the "more" link doesn't float away:
<pre>
.mw-compact-toggle .mw-collapsible-toggle {
float: none !important;
display: inline-block !important;
margin-left: 0.5em;
vertical-align: top !important;
}
</pre>
</noinclude>
|