ShortURLPlugin

The "Short URL TWiki Plugin" allows to shorten long URLs from something like http://twiki.org/cgi-bin/view/Main/WebHome to http://twiki....ebHome. This plugin aims to improve table rendering of long links if the data is provided by a database. Note that only URLs where the URL text matches the "href:" attribute are altered. That means all wiki words are unaffected by this plugin.

Syntax Rules

Not applicable, there is no syntax you need to embed into your twiki pages.

Examples

Not applicable, see note under Syntax Rules.

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %NEWPLUGIN_SHORTDESCRIPTION%

  • One line description, shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = This plugin does shorten URLs to a user specifiable length.

  • Your can disable the pugin:
    • Set DISABLE = 1

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

  • This parameter allows to set the length the URL is shortened to:
    • Set URLMAXLENGTH = 16 (number of characters long URLs are shortened to)

  • This parameter is used to specify what URLs (http://..., https://..., file:// ) the shortening is applied to:
    • Set SCHEMES = http https

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 TWiki server.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip ShortURLPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/ShortURLPlugin.txt Plugin topic
    data/TWiki/ShortURLPlugin.txt,v Plugin topic repository
    lib/TWiki/Plugins/ShortURLPlugin.pm Plugin Perl module
    data/Main/ShortURLPlugin.txt Plugin Test and demo page
  • Configure the Plugin:
    • TWiki 4.0 and up: Run the configure script to enable the Plugin
    • Change the Plugin settings as needed
  • Test if the installation was successful:

  • If you want to run the plugin only on specific pages you can disable it * Set DISABLEDPLUGINS = ShortURLPlugin on the TWikiPreferences and then enable it on the local page with another =* Set DISABLEDPLUGINS = instruction.

Plugin Info

Plugin Author: TWiki:Main.KarlKaiser based on TWiki:Main.IanBygrave TWiki:Plugins.ExitPlugin
Copyright: © 2007, TWiki:Main.KarlKaiser
License: GPL (GNU General Public License)
Plugin Version: 08 Jun 2007 (V1.000)
Change History:  
08 Jun 2007: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Benchmarks: GoodStyle nn%, FormattedSearch nn%, ShortURLPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/ShortURLPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ShortURLPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/ShortURLPluginAppraisal

Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

-- TWiki:Main.KarlKaiser - 08 Jun 2007

Topic revision: r17 - 2007-06-08 - KarlKaiser
 
Congregation Kadimah–Toras Moshe | 113 Washington Street, Brighton, MA  02135 | (617) 254-1333
This site is powered by the TWiki collaboration platformCopyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.ShortURLPlugin.