Template:Show

From New wiki
Revision as of 17:31, 19 December 2025 by Wikilah admin (talk | contribs)
Jump to navigation Jump to search

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;
}