Template:Show: Difference between revisions

Content deleted Content added
No edit summary
Tag: Reverted
No edit summary
Tags: Manual revert Reverted
Line 1:
<includeonly><{{#ifeq:{{{inline|}}}|yes|span|div}} class="mw-collapsible {{#ifeq:{{lc:{{{state|collapsed}}}}}|expanded||mw-collapsed}}" id="mw-customcollapsible-{{{id|1}}}" style="display#ifeq:inline; {{{stylecompact|}}}|yes|mw-compact-toggle|}}">
data-expandtext="{{{expandtext|more ▾}}}"
<span class="mw-collapsible-content" style="display:inline;">
data-collapsetext="{{{collapsetext|less ▴}}}"
{{{text|}}}<span class="mw-customtoggle-{{{id|1}}}" style="cursor:pointer; color:#0645ad; margin-left:0.5em; vertical-align:baseline; display:inline;">{{{collapsetext|less ▴}}}</span>
style="{{#ifeq:{{{inline|}}}|yes|display:inline;}}{{#ifeq:{{{compact|}}}|yes|display:inline-block; vertical-align:top;}} {{{style|}}}">
</span>
<{{#ifeq:{{{inline|}}}|yes|span|div}} class="mw-collapsible-content" style="{{#ifeq:{{{inline|}}}|yes|display:inline;}}">
</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>
{{{text|}}}</{{#ifeq:{{{inline|}}}|yes|span|div}}>
 
</{{#ifeq:{{{inline|}}}|yes|span|div}}></includeonly><noinclude>
== Usage ==
Standard block usage (floats toggle to the far right):
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.
<pre>
{{show
|text=The primary driver for the acquisition was the target's proprietary AI technology.
}}
</spanpre>
 
== 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 thatis willshort span multiple lines. When it expands,and the "less" button willstays stayclose right here at theand endaligned.
}}
</pre>
 
== Parameters ==
* '''text''': The content to be hidden/shown.
* '''id''': (Required if multiple on one page) A unique name like "1", "2", "bio", etc.
* '''textexpandtext''': The contenttext for the "show" link (Defaults to "more ▾").
* '''expandtextcollapsetext''': The text for the "hide" link (Defaults to "moreless ").
* '''collapsetextinline''': DefaultsSet to "less ▴yes" to use span tags.
* '''statecompact''': Set to "expandedyes" to showkeep bythe defaulttoggle link next to the text and fix the "push down" alignment issue.
* '''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>