Text Toggle Plugin
The Text Toggle Plugin is used to toggle off and on the display of text. Text is replaced with a link that will make the text reappear when clicked. The primary use of this plugin is to simplify complex web pages by omitting details but allowing them to be easily selected and viewed in context.
Syntax Rules
This Plugin adds the tags %TOGGLESTART{}% xxxxxxx %TOGGLEEND%
The text between these tags is by default replaced with a link that restores the text when clicked.
*The following parameters are supported by %TOGGLESTART{}%
| Parameter |
Description |
Default |
| default |
either open or closed . Controls the default manner of text display |
closed |
| style |
either toggle plusminus or text . text style sets the toggle to a text link |
toggle |
| txt |
This text appears after the icons or text used by the expand and cut links |
|
| expandtxt |
The text used by the expand toggle link when style = text |
... |
| cutstart |
The txt used by the hide text toggle at the start of the text block |
|
| cutend |
The txt used at the end of a toggle when the text is being displayed. |
hide |
| id |
Give the toggle a specific id. This is reflected in both the named achor associated with the text block and the parameter passed to the twiki page to toogle on and off text. |
an auto generated number |
When you need to open all Text Toggles
To open every text toggle in a TWiki page pass the parameter
toggle_all_open to the page. e.g. the following
<a href="?toggle_all_open=1"> works for this page.
Nesting Toggles
TOGGLESTART,TOGGLEEND pairs can be nested within other TOGGLESTART,TOGGLEEND pairs
Example
Example text:
If you wish to read further click %TOGGLESTART{}% here. but it may not be worth reading.
Infact the stuff on this line isn't worth reading either
as for the third line well
%TOGGLEEND%
Example Demo (Simulated Closed):
If you wish to read further click
Example Demo (Simulated Open):
If you wish to read further click

here. but it may not be worth reading.
Infact the stuff on this line isn't worth reading either
as for the third line well
Example Demo: (Will only work if TextTogglePlugin is installed)
If you wish to read further click %TOGGLESTART{ id="eg" txt="here" }% but it may not be worth reading.
Infact the stuff on this line isn't worth reading either
as for the third line well
%TOGGLEEND%
Plugin Settings
Plugin settings are stored as preferences variables. To reference
a plugin setting write
%<plugin>_<setting>%, i.e.
%DEFAULTPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Toggle on and off the display of text blocks.
- Default Toggle Style: Set the default toggle style, optionally per web..
- Set DEFAULTTOGGLESTYLE = toggle
- Debug plugin: (See output in
data/debug.txt)
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
- Unzip
TextTogglePlugin.zip in your twiki installation directory. Content: | File: | Description: |
data/TWiki/TextTogglePlugin.txt | Plugin topic |
data/TWiki/TextTogglePlugin.txt,v | Plugin topic repository |
pub/TWiki/TextTogglePlugin/arrow-down.jpg | Plugin image |
pub/TWiki/TextTogglePlugin/arrow-right.jpg | Plugin image |
pub/TWiki/TextTogglePlugin/minus.jpg | Plugin image |
pub/TWiki/TextTogglePlugin/plus.jpg | Plugin image |
lib/TWiki/Plugins/TextTogglePlugin.pm | Plugin Perl module |
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins,
EmptyPlugin
--
TWiki:Main/PatrickDiamond
- 09 Dec 2004
--
RAllanKirkhart - 21 Dec 2004