linking1Add my vote for this tag rendering1Add my vote for this tag create new tag
, view all tags


Shorten external URLs to a user specifiable length


The "Short URL TWiki Plugin" supports shortening 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.


Not applicable, see note under Syntax Rules.

Plugin Settings

Plugin settings are stored as preferences settings. Do not change the settings here, they are here only for illustration purposes showing the default values. Define the settings in Main.TWikiPreferences. For example, to customize the SHORTURLPLUGIN_URLMAXLENGTH setting, add a * Set SHORTURLPLUGIN_URLMAXLENGTH = ... bullet in Main.TWikiPreferences.

  • Your can disable the plugin:

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

  • Set the number of characters long URLs are shortened to:
    • Set URLMAXLENGTH = 20

  • This parameter is used to specify what URLs (http://..., https://..., file://...) the shortening is applied to:
    • Set SHORTURLPLUGIN_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.

  • For an automated installation, run the configure script and follow "Find More Extensions" in the in the Extensions section.

  • Or, follow these manual installation steps:
    • Download the ZIP file from the Plugins home (see below).
    • Unzip ShortURLPlugin.zip in your twiki installation directory. Content:
      File: Description:
      data/TWiki/ShortURLPlugin.txt Plugin topic
      data/Sandbox/TestShortURLPlugin.txt Test topic
      lib/TWiki/Plugins/ShortURLPlugin.pm Plugin Perl module
    • Set the ownership of the extracted directories and files to the webserver user.

  • Plugin configuration and testing:
    • Run the configure script, enable the plugin in the Plugins section, and configure the plugin in the Extensions section.
    • Test if the installation was successful: Go to TestShortURLPlugin and check if the page looks right.

  • If you want to run the plugin only on specific pages you can disable it with a * Set DISABLEDPLUGINS = ShortURLPlugin setting in the TWikiPreferences and then enable it on specific pages with a * Set DISABLEDPLUGINS = setting.

Plugin Info

  • Set SHORTDESCRIPTION = Shorten external URLs to a user specifiable length

Plugin Author: TWiki:Main.KarlKaiser based on TWiki:Main.IanBygrave TWiki06x00:Plugins.ExitPlugin
Copyright: © 2007, TWiki:Main.KarlKaiser
© 2008-2011 TWiki:TWiki.TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 2011-06-10
Change History:  
2011-05-14: TWikibug:Item6701: Import into Subversion; doc improvements -- TWiki:Main.PeterThoeny
11 Jun 2007-07-11: Fixed some preferences setting issues
08 Jun 2007-07-08: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins/Benchmark: 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: TestShortURLPlugin, TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 ShortURLPlugin.md5 r2 r1 manage 0.2 K 2011-06-11 - 04:29 PeterThoeny  
Compressed Zip archivetgz ShortURLPlugin.tgz r3 r2 r1 manage 5.2 K 2011-06-11 - 04:29 PeterThoeny  
Compressed Zip archivezip ShortURLPlugin.zip r4 r3 r2 r1 manage 7.1 K 2011-06-11 - 04:28 PeterThoeny  
Unknown file formatEXT ShortURLPlugin_installer r1 manage 3.4 K 2011-06-11 - 04:29 PeterThoeny  
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2013-10-16 - PeterThoeny
  • 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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.