ShortURLPlugin
Shorten external URLs to a user specifiable length
Overview
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.
Examples
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:
- Set SHORTURLPLUGIN_DISABLE = 0
- Debug plugin: (See output in
data/debug.txt) ( 1 = debug enabled, 0 = debug disabled )
- Set SHORTURLPLUGIN_DEBUG = 0
- Set the 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 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
Related Topics: TestShortURLPlugin,
TWikiPlugins,
DeveloperDocumentationCategory,
AdminDocumentationCategory,
TWikiPreferences