Template:Show: Difference between revisions
Content deleted Content added
No edit summary Tag: Reverted |
No edit summary Tag: Manual revert |
||
Line 1:
<includeonly><{{#ifeq:{{{inline|}}}|yes|span|div}} class="mw-collapsible {{#ifeq:{{lc:{{{state|collapsed}}}}}|expanded||mw-collapsed}} {{#ifeq:{{{compact|}}}|yes|mw-compact-toggle|}}"
data-expandtext="{{{expandtext|more ▾}}}"
style="{{#ifeq:{{{inline|}}}|yes|display:inline;}}{{#ifeq:{{{compact|}}}|yes|display:inline;}} {{{style|}}}">▼
data-collapsetext="{{{collapsetext|less ▴}}}"
▲style="{{#ifeq:{{{inline|}}}|yes|display:inline;}}{{#ifeq:{{{compact|}}}|yes|display:inline-block; vertical-align:baseline;}} {{{style|}}}">
|}}▼
<{{#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 ==
Line 23 ⟶ 15:
== Compact Usage ==
This
<pre>
{{show
Line 29 ⟶ 21:
|text=This text is short and the button stays close and aligned.
}}
</pre>
== Custom Labels ==
To change the "more" and "less" buttons:
<pre>
{{show
|expandtext=Read Bio
|collapsetext=Close
|text=John Doe has been the CEO since 2010...
</pre>
== Inline Usage ==
To use within a sentence (uses span tags):
<pre>
The company reported a record revenue {{show|inline=yes|text=of $1.2B in Q4 2025.|expandtext=(more)}}
</pre>
Line 35 ⟶ 43:
* '''expandtext''': The text for the "show" link (Defaults to "more ▾").
* '''collapsetext''': The text for the "hide" link (Defaults to "less ▴").
* '''inline''': Set to "yes" to use span tags (remains part of the paragraph).
* '''compact''': Set to "yes" to
* '''state''': Set to "expanded" to have the text visible on page load.
* '''style''': Pass additional CSS styles directly.
== Required CSS ==
<pre>
float: none !important;
display: inline !important;
vertical-align: baseline !important;
▲.mw-compact-show, .mw-compact-hide {
}
</pre>
| |||