As this is an input filter, it will only work where input filters are applied.

This input filter must come after the HTML filter, and should go after the convert line breaks filter.

To make a section of text collapsible, surround it with [collapse] and [/collapse]. You may nest the [collapse] tags to have collapsible sections within collapsible sections.

To make the text collapsed initially, start with [collapse collapsed]. As a shortcut, you may use [collapsed], as this will be expanded into [collapse collapsed].

You may supply a title to be displayed in two ways. There is a title= option for the [collapse] tag, or the module will find the first header tag and use that instead. New in 6.x-2.5, you can control the default title used if one isn't specified.

Also supported is a class= option, which allows you to add CSS classes.

Older versions had a slightly different specification, which is still supported.

Read the filter tips for more information.

2013-01-17: There is a sandbox module available called Collapse Text WYSIWYG which may add integration with CKEditor. I don't use a WYSIWYG editor, so have not tested this, and don't know how well it works, but those with WYSIWYG proclivities may be interested.

Credit: Thanks to Pukku who is the original owner of the module

Project information