Extension:Collapsmi

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
Collapsmi
Release status: stable
Implementation Tag
Description Enables collapsing and expanding content. a.k.a. Show/Hide
Author(s) Sami Islam (SamiIslamtalk)
Latest version 1.0.0 (2011-11-23)
MediaWiki 1.16.2
PHP 5.3.6
Database changes No
License GNU General Public License 3.0 or later
Download Template:WikimediaDownload/svn
Tags
<collapsmi>
Hooks used
ParserFirstCallInit
Translate the Collapsmi extension if it is available at translatewiki.net
Check usage and version matrix.

What can this extension do?[edit]

Collapsmi allows collapsing and expanding some content which can either be simple text, wiki markup or even a web-site.

It only has a handful of attributes some of which can be combined.

The usage section below lists the attributes and the default and possible values.

The pictures below show the wiki syntax and what the tags look like.

Tested using[edit]

Product Version
MediaWiki 1.16.2
PHP 5.3.6 (apache2handler)
Opera 11.5.2
Firefox 7.0.1
Internet Explorer 9.0.8112.16421

Usage[edit]

There are only a handful of attributes of the tag:

Attribute Default value Possible values Meaning
UniqueId autogenerated Any value of e.g. '1', 'one', '1one' Uniquely identifies a tag on a page
BackgroundColor #FFFFCC Any valid html color code The background colour for the tag content
CollapseText 'Collapse' or 'Collapse All' or 'Collapse specific tags' Any text The text to show for the collapse label
ExpandText 'Expand' or 'Expand All' or 'Expand specific tags' Any text The text to show for the expand label
ExpandByDefault true 'true' or 'false' Should the content for a tag be expanded by default?
toggle false 'all', a string with a list of unique ids in the format: 'uniqueId1;uniqueId2;uniqueId3;...' This attribute can either toggle all tags or specific tags BUT NO tag with this attribute
url false Any valid url The url to show as the content of a tag
urlheight 500 Any valid number as text e.g. '500' The height of the url to show as the content of a tag. This can only be used in conjunction to the url attribute.

Examples[edit]

The following screen shots show the wiki syntax and its result: CollapsiUsage1.png CollapsmiUsage2.png CollapsmiUsage3.png

Installation[edit]

To install this extension add the following to LocalSettings.php:

require_once( "$IP/extensions/Collapsmi/Collapsmi.php" );

Copy the files Collapsmi.php, Collapsmi.i18n.php and Collapsmi.body.php under the Mediawiki extensions folder for Collapsmi (/extensions/Collapsmi/).

Collapsmi code[edit]

Please use the download link above to get the code.

To discuss new ideas or changes[edit]

Please use the Discussion page to discuss new ideas or changes.