Tags:
rendering2Add my vote for this tag user_interface2Add my vote for this tag create new tag
, view all tags

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)
    • Set DEBUG = 0

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

Plugin Author: TWiki:Main.PatrickDiamond
Plugin Version: 9 Dec 2004 (1.001)
Change History:  
9 Dec 2004: Fix for nested toggles
8 Dec 2004: Initial version
TWiki Dependency: TWiki version 01 Feb 2003 or later
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.0005
TWiki:Plugins/Benchmark: GoodStyle 99%, FormattedSearch 99%, TextTogglePlugin 96%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/TextTogglePlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/TextTogglePluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/TextTogglePluginAppraisal

Related Topics: TWikiPreferences, TWikiPlugins, EmptyPlugin

-- TWiki:Main/PatrickDiamond - 09 Dec 2004 -- RAllanKirkhart - 21 Dec 2004

Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivezip TextTogglePlugin.zip r5 r4 r3 r2 r1 manage 7.7 K 2004-12-21 - 13:38 PatrickDiamond TextTogglePlugin 9th Dec 2004 (with doc update, 21st Dec)
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2004-12-21 - PatrickDiamond
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.