Template:Show: Difference between revisions
Appearance
Content deleted Content added
No edit summary Tags: Manual revert Reverted |
No edit summary Tag: Reverted |
||
| Line 1: | Line 1: | ||
<includeonly><{{#ifeq:{{{inline|}}}|yes|span|div}} class="mw-collapsible {{#ifeq:{{lc:{{{state|collapsed}}}}}|expanded||mw-collapsed}} {{#ifeq:{{{compact|}}}|yes|mw-compact-toggle|}}" |
<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 ▾}}}" |
|||
data-collapsetext="{{{collapsetext|less ▴}}}" |
|||
{{#ifeq:{{{compact|}}}|yes| |
|||
| ⚫ | |||
<span class="mw-collapsible-toggle mw-compact-show" style="cursor:pointer; color:#0645ad;" role="button" tabindex="0">{{{expandtext|more ▾}}}</span> |
|||
|}} |
|||
<{{#ifeq:{{{inline|}}}|yes|span|div}} class="mw-collapsible-content" style="{{#ifeq:{{{inline|}}}|yes|display:inline;}}"> |
<{{#ifeq:{{{inline|}}}|yes|span|div}} class="mw-collapsible-content" style="{{#ifeq:{{{inline|}}}|yes|display:inline;}}"> |
||
{{{text|}}} |
{{{text|}}} |
||
{{#ifeq:{{{compact|}}}|yes| |
|||
<span class="mw-collapsible-toggle mw-compact-hide" style="cursor:pointer; color:#0645ad;" role="button" tabindex="0">{{{collapsetext|less ▴}}}</span> |
|||
|}} |
|||
</{{#ifeq:{{{inline|}}}|yes|span|div}}> |
|||
</{{#ifeq:{{{inline|}}}|yes|span|div}}></includeonly><noinclude> |
</{{#ifeq:{{{inline|}}}|yes|span|div}}></includeonly><noinclude> |
||
== Usage == |
== Usage == |
||
| Line 15: | Line 23: | ||
== Compact Usage == |
== Compact Usage == |
||
This version |
This version keeps the link inline at the natural end of the text. |
||
<pre> |
<pre> |
||
{{show |
{{show |
||
| Line 28: | Line 36: | ||
* '''collapsetext''': The text for the "hide" link (Defaults to "less ▴"). |
* '''collapsetext''': The text for the "hide" link (Defaults to "less ▴"). |
||
* '''inline''': Set to "yes" to use span tags. |
* '''inline''': Set to "yes" to use span tags. |
||
* '''compact''': Set to "yes" to |
* '''compact''': Set to "yes" to use the inline run-in toggle style. |
||
* '''state''': Set to "expanded" to have the text visible on page load. |
* '''state''': Set to "expanded" to have the text visible on page load. |
||
* '''style''': Pass additional CSS styles directly. |
* '''style''': Pass additional CSS styles directly. |
||
== Required CSS == |
== Required CSS == |
||
Add this to your [[MediaWiki:Common.css]] |
Add this to your [[MediaWiki:Common.css]]: |
||
<pre> |
<pre> |
||
/* Compact Toggle Logic */ |
|||
| ⚫ | |||
/* 1. When expanded, hide the 'Show' link */ |
|||
float: none !important; |
|||
.mw-collapsible:not(.mw-collapsed) .mw-compact-show { |
|||
display: inline-block !important; |
|||
display: none !important; |
|||
} |
|||
vertical-align: top !important; |
|||
/* 2. When collapsed, the 'Hide' link is naturally hidden because |
|||
its parent (.mw-collapsible-content) is hidden by MW default CSS. */ |
|||
/* Optional: Ensure pointer cursor if inline styles are stripped */ |
|||
| ⚫ | |||
cursor: pointer; |
|||
} |
} |
||
</pre> |
</pre> |
||
Revision as of 01:31, 20 December 2025
Usage
Standard block usage (floats toggle to the far right):
{{show
|text=The primary driver for the acquisition was the target's proprietary AI technology.
}}
Compact Usage
This version keeps the link inline at the natural end of the text.
{{show
|compact=yes
|text=This text is short and the button stays close and aligned.
}}
Parameters
- text: The content to be hidden/shown.
- 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.
- compact: Set to "yes" to use the inline run-in toggle style.
- 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:
/* Compact Toggle Logic */
/* 1. When expanded, hide the 'Show' link */
.mw-collapsible:not(.mw-collapsed) .mw-compact-show {
display: none !important;
}
/* 2. When collapsed, the 'Hide' link is naturally hidden because
its parent (.mw-collapsible-content) is hidden by MW default CSS. */
/* Optional: Ensure pointer cursor if inline styles are stripped */
.mw-compact-show, .mw-compact-hide {
cursor: pointer;
}