Template:Show: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary Tag: Reverted |
No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly>< |
<includeonly><div class="mw-collapsible {{#ifeq:{{lc:{{{state|collapsed}}}}}|expanded||mw-collapsed}}" |
||
data-expandtext="{{{expandtext|more ▾}}}" |
|||
| ⚫ | |||
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="{{{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> |
|||
{{{text|}}} |
|||
| ⚫ | |||
</div></includeonly><noinclude> |
|||
== Usage == |
== Usage == |
||
A simple collapsible block for hiding/showing content. |
|||
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> |
<pre> |
||
{{show |
{{show |
||
|text=The primary driver for the acquisition was the target's proprietary AI technology. |
|||
|id=bio1 |
|||
}} |
|||
|compact=yes |
|||
</pre> |
|||
|text=This is a very long text that will span multiple lines. When it expands, the "less" button will stay right here at the end. |
|||
== 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> |
</pre> |
||
== Parameters == |
== Parameters == |
||
* '''text''': The content to be hidden/shown. |
|||
* '''id''': (Required if multiple on one page) A unique name like "1", "2", "bio", etc. |
|||
* ''' |
* '''expandtext''': The text for the "show" link (Defaults to "more ▾"). |
||
* ''' |
* '''collapsetext''': The text for the "hide" link (Defaults to "less ▴"). |
||
* ''' |
* '''state''': Set to "expanded" to have the text visible on page load. |
||
* ''' |
* '''style''': Pass additional CSS styles directly to the container. |
||
[[Category:Generic templates]] |
|||
</noinclude> |
</noinclude> |
||
Latest revision as of 09:51, 21 December 2025
Usage
A simple collapsible block for hiding/showing content.
{{show
|text=The primary driver for the acquisition was the target's proprietary AI technology.
}}
Custom Labels
To change the "more" and "less" buttons:
{{show
|expandtext=Read Bio
|collapsetext=Close
|text=John Doe has been the CEO since 2010...
}}
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 ▴").
- state: Set to "expanded" to have the text visible on page load.
- style: Pass additional CSS styles directly to the container.