You are here: TWiki> Plugins Web>HideInEditModePlugin (2008-12-12, SopanShewale)
Tags:
access_control1Add my vote for this tag create new tag
, view all tags

HideInEditModePlugin

This is a plugin that you can use to hide one or two blocks of text in the edit page, so that the text cannot be edited or changed unless the user has the access permission. The text is still rendered in the view page.

Syntax Rules

  • %STARTHIDDEN% ... %ENDHIDDEN%, which is the equivalent of
  • %STARTHIDDEN{"top"}% ... %ENDHIDDEN%
  • %STARTHIDDEN{"bottom"}% ... %ENDHIDDEN%
  • Text outside the %STARTHIDDEN% ... %ENDHIDDEN% is not hidden in the edit page, thus it can be edited like the normal way.
  • The access permission is controlled by the ALLOWTOPICHIDDEN preference variable. Only people listed in the ALLOWTOPICHIDDEN variable that can edit the hidden text. Obviously, the ALLOWTOPICHIDDEN variable must be set inside the %STARTHIDDEN% ... %ENDHIDDEN% so that a user who has write access (but not listed in the ALLOWTOPICHIDDEN) cannot change the variable.

Examples

%<nop>STARTHIDDEN%

<!--
   * Restrict who can see/edit the hidden text
      * Set ALLOWTOPICHIDDEN = Main.JoeSomebody
-->

Hello World

%ENDHIDDEN%

HideInEditModePlugin Global Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, for example, %HIDDENTEXTPLUGIN_SHORTDESCRIPTION%

  • One line description, shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Hide a block of text in the edit page

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

Known Problems

Currently everything is visible in raw view. This is clearly not the right thing. Help?

Plugin Installation Instructions

Note: The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip HideInEditModePlugin.zip in your twiki installation directory. Content:
File: Description:
data/TWiki/HideInEditModePlugin.txt Plugin topic
data/TWiki/HideInEditModePlugin.txt,v Plugin topic repository
lib/TWiki/Plugins/HideInEditModePlugin.pm Plugin Perl module
data/Sandbox/HiddenTextTrash.Test.txt Text page

Plugin Info

Plugin Author: TWiki:Main/DonnyKurniawan, TWiki:Main/MeredithLesly
Plugin Version: 04 Oct 2003 (VTrash.1.00Trash.1)
Change History:  
06 Feb 2006: Added tags to allow hidden text above and below the rest of the text
04 Oct 2003: Change the syntax so that the hidden block can include '}%'
03 Oct 2003: Initial version
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Plugin Trash.Home: http://TWiki.org/cgi-bin/view/Plugins/HideInEditModePlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/HideInEditModePluginDev

Related Topics: TWikiPreferences, TWikiPlugins

-- TWiki:Main.MeredithLesly - 25 Feb 2006

Topic attachments
I Attachment Action Size Date Who Comment
zipzip HideInEditMode.zip manage 6.6 K 2006-02-27 - 19:37 MeredithLesly  
elsemd5 HideInEditModePlugin.md5 manage 0.2 K 2008-12-12 - 11:34 SopanShewale checksum file , Uploaded as a part of Release Process
ziptgz HideInEditModePlugin.tgz manage 4.4 K 2008-12-12 - 11:33 SopanShewale See HideInEditModePlugin for details. Untar and run the installer script, Uploaded as a part of Release Process
zipzip HideInEditModePlugin.zip manage 6.2 K 2008-12-12 - 11:34 SopanShewale See HideInEditModePlugin for details. Unzip and run the installer script , Uploaded as a part of Release Process
elseEXT HideInEditModePlugin_installer manage 3.5 K 2008-12-12 - 11:34 SopanShewale Installer Script, Uploaded as a part of Release Process
Topic revision: r7 - 2008-12-12 - 11:34:11 - SopanShewale
Plugins.HideInEditModePlugin moved from Trash.HideInEditModePlugin on 2006-05-29 - 17:11 by PeterThoeny - put it back
 

Plugins

share: Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon
Twiki, Inc.
This site is powered by the TWiki collaboration platform
Ideas, requests, problems regarding TWiki? Send feedback
Copyright © 1999-2010 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.