Extension:CollapsableText

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
CollapsableText

Release status: stable

Implementation Tag
Description Adds a table to easily hide/show portions of text
Author(s) Stéphane GALLAND (sgalland-arakhneTalk)
Last version 1.0
License GPL
Download http://www.arakhne.org/mediawiki/CollapsableText/

Check usage (experimental)

Contents

[edit] Description

CollapsableText is an extension of Mediawiki to create automatically portions of text which are collapsable.

[edit] Installation

  1. Download CollapsableText,
  2. Unpack the archive in your Mediawiki directory
  3. add require_once('extensions/CollapsableText/CollapsableText.php'); in your LocalSettings.php.
  4. You should skip this step if your Mediawiki installation directory is the same as your Apache document directory.
    Icons used by this extensions should be accessible from the web client navigator. Icons are inside the directory extensions/CollapsableText/public.
    You must make this directory accessible from a browser with the URL /extensions/CollapsableText/:
    • on Unix operating systems (including MacOS X):
      $> ln -s /path/to/mediawiki/extensions/CollapsableText/public /path/to/apache/document/root/wiki/extensions/CollapsableText
    • on other operating systems (including Windows®): copy the content of /path/to/mediawiki/extensions/CollapsableText/public into /path/to/apache/document/root/wiki/extensions/CollapsableText

[edit] Usage

[edit] General Usage

CollapsableText extension provides only one HTML tag: <collapsetext/>. This tag permits to mark some part of the wikitext as collapsable:

<collapsetext>This is the Title (always visible). This is the collapsed text (visible when not collapse).</collapsetext>


The text inside <collapsetext/> is parsed to detect a part which must be always visible and a part will could be invisible. The rules to detect both parts are (in preferred order):

  1. The first occurrence of the tag <collapsetext/> is the limit between the two parts.
    Example: <collapsetext>ABC. DEF.<collapse>GHI.</collapsetext>
  2. The first part is enclosed by braces.
    Example: <collapsetext>{ABC. DEF.} GHI.</collapsetext>
  3. The first part is the first sentence (first occurrence of the point).
    Example: <collapsetext>ABC. DEF. GHI.</collapsetext>


[edit] Tag Parameters

Tag <collapsetext/> accepts parameters:

  • show="true" or show="false": permits to force the visibility flag when showing up the page (default is false);
  • titleclass="css_style": permits to change the CSS class associated to the first part of the text (default is collapsedtexttitle);
  • bodyclass="css_style": permits to change the CSS class associated to the second part of the text (default is collapsedtextbody).
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox