You are here

README.txt in Collapse Text 7.2

Same filename and directory in other branches
  1. 5 README.txt
  2. 6.2 README.txt
  3. 6 README.txt
collapse_text.module is an input filter to allow sections of text to be
made into collapsible sections (like on editing forms).

Surround a section of text with `[collapse]` and `[/collapse]` to make
that section collapsible. You may nest `[collapse]` tags within
other `[collapse]` tags.

Use the `[collapsed]` tag to make the section default to collapsed.
`[collapsed]` is the same thing as `[collapse collapsed]`, if you prefer
to use the longer form.

The title for the section may be specified in two ways:

- You may add a "title=" parameter to the opening tag, such as
  `[collapse title="your title here"]`. Titles should be surrounded
  by double-quotes. You can use HTML entities in titles, so use
  `"` if you need to include them in your title.
- If a title is not specified in the `[collapse]` tag, the module will
  search forward until the next `[collapse]` or `[/collapse]` tag, and
  find the first HTML header (<h1>, <h2>, ..., <h6>) and use that for
  the title. This will be removed from the text to prevent duplication.

If a title is not specified, there is a default title that will be used.

You may also add a "class=" parameter to specify CSS classes to be added
to the section. These classes should be surrounded by double-quotes, and
separated by spaces: `[collapse class="class1 class2 class3"]`.

The parameters may be combined in (almost) any order. The "collapsed"
parameter must come right after the word "collapse". If you wish to
put the "collapsed" parameter anywhere else, you need to specify it as
`collapsed="collapsed"`:
    `[collapse title="title" collapsed="collapsed" class="class1"]`

If you need to actually have the string `[collapse` show up anywhere in
the text, you will need to escape the tag by prefixing it with a backslash:
    `\[collapse`
The first backslash before any instance of `[collapse` will be removed
from the final displayed text, so if you want to display `\[collapse`,
you should enter `\\[collapse`, and if you want to display `\\[collapse`,
you will need to type `\\\[collapse`, etc.

You may use angle brackets instead of straight brackets to surround the
collapse tag if you wish: `<collapse>` will be turned into `[collapse]`
and function the same.

For backwards compatibility, this module supports a few variations which
should not be used going forward. The "class=" parameter used to be
"style=". It used to be that the "style=" and "title=" parameters did
not require quotes. For this to work, the "style=" parameter must come
before the "title=" parameter.

There are two theme functions you can override if you need to.

- `theme_collapse_text_fieldset()` renders the actual fieldset.
- `theme_collapse_text_form()` renders the enclosing form.

N.B. The HTML corrector filter is known to cause collapsible text to
not function properly.  If you use HTML corrector, make sure that you
arrange your filters such that collapse text is below (heavier than)
HTML corrector.  You can find this setting in admin/settings/filters.

File

README.txt
View source
  1. collapse_text.module is an input filter to allow sections of text to be
  2. made into collapsible sections (like on editing forms).
  3. Surround a section of text with `[collapse]` and `[/collapse]` to make
  4. that section collapsible. You may nest `[collapse]` tags within
  5. other `[collapse]` tags.
  6. Use the `[collapsed]` tag to make the section default to collapsed.
  7. `[collapsed]` is the same thing as `[collapse collapsed]`, if you prefer
  8. to use the longer form.
  9. The title for the section may be specified in two ways:
  10. - You may add a "title=" parameter to the opening tag, such as
  11. `[collapse title="your title here"]`. Titles should be surrounded
  12. by double-quotes. You can use HTML entities in titles, so use
  13. `"` if you need to include them in your title.
  14. - If a title is not specified in the `[collapse]` tag, the module will
  15. search forward until the next `[collapse]` or `[/collapse]` tag, and
  16. find the first HTML header (

    ,

    , ...,

    ) and use that for
  17. the title. This will be removed from the text to prevent duplication.
  18. If a title is not specified, there is a default title that will be used.
  19. You may also add a "class=" parameter to specify CSS classes to be added
  20. to the section. These classes should be surrounded by double-quotes, and
  21. separated by spaces: `[collapse class="class1 class2 class3"]`.
  22. The parameters may be combined in (almost) any order. The "collapsed"
  23. parameter must come right after the word "collapse". If you wish to
  24. put the "collapsed" parameter anywhere else, you need to specify it as
  25. `collapsed="collapsed"`:
  26. `[collapse title="title" collapsed="collapsed" class="class1"]`
  27. If you need to actually have the string `[collapse` show up anywhere in
  28. the text, you will need to escape the tag by prefixing it with a backslash:
  29. `\[collapse`
  30. The first backslash before any instance of `[collapse` will be removed
  31. from the final displayed text, so if you want to display `\[collapse`,
  32. you should enter `\\[collapse`, and if you want to display `\\[collapse`,
  33. you will need to type `\\\[collapse`, etc.
  34. You may use angle brackets instead of straight brackets to surround the
  35. collapse tag if you wish: `` will be turned into `[collapse]`
  36. and function the same.
  37. For backwards compatibility, this module supports a few variations which
  38. should not be used going forward. The "class=" parameter used to be
  39. "style=". It used to be that the "style=" and "title=" parameters did
  40. not require quotes. For this to work, the "style=" parameter must come
  41. before the "title=" parameter.
  42. There are two theme functions you can override if you need to.
  43. - `theme_collapse_text_fieldset()` renders the actual fieldset.
  44. - `theme_collapse_text_form()` renders the enclosing form.
  45. N.B. The HTML corrector filter is known to cause collapsible text to
  46. not function properly. If you use HTML corrector, make sure that you
  47. arrange your filters such that collapse text is below (heavier than)
  48. HTML corrector. You can find this setting in admin/settings/filters.