Link ExternalSite:Page text to external sites based on aliases defined in a rules topic
The InterwikiPlugin links ExternalSite:Page text to external sites based on
aliases defined in the InterWikis topic. This plugin is inspired by
UseMod Wiki's inter-wiki links,
http://www.usemod.com/cgi-bin/wiki.pl?InterWiki.
Enter ExternalSite:Page to create a link that points to the Page on the ExternalSite server.
If Page contains spaces, it can be enclosed in single or double quotes. Example: MySite:'My Photo.jpg'. Special characters contained within the quotes are URL encoded.
Enter [[ExternalSite:Page][any label]] to specify a custom label.
All ExternalSite aliases are defined in the InterWikis topic or as specified by the INTERWIKIPLUGIN_RULESTOPIC topic list.
Each entry must be three or four columns, using the following format: | External site alias | URL | Tooltip help text | Optional INTERLINKFORMAT override |.
The Alias must start with an upper case letter and may contain alphanumeric characters.
The URL and Tooltip Text may contain optional $page formatting tokens; the token gets expanded to the page name.
The URL may contain Foswiki macros. They are expanded when the URL is rendered.
For links with parentheses you will need to write as [[Wikipedia:Fork_(software_development)]], or quoted, as Wikipedia:'Fork_(software_development)'
as the plugin will not include the closing parenthesis as part of the link.
InterwikiPlugin Settings
You can override the default settings using preferences. These preferences can be set in your SitePreferences, or in any WebPreferences, or in individual topics.
Preference
Use to
Default
INTERWIKIPLUGIN_RULESTOPIC
The topic(s) containing the inter-wiki rules. Can be a comma separated list. See InterWikis for more details
The INTERWIKIPLUGIN_INTERLINKFORMAT supports a number of formatting tokens:
Token
Meaning
$site
Site alias
$page
Page (part after colon)
$url
Site URL (might contain $page)
$label
Equal to $site:$page
$tooltip
Tooltip message
Installation Instructions
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. "Extensions Operation and Maintenance" Tab -> "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button.
Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will not show up in the
search results.
You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
cd /path/to/foswiki
perl tools/extension_installer <NameOfExtension> install
Foswiki:Main.AndrewJones - Fix inter-wiki's with parentheses (Foswikitask:Item10151). Note, you will need to write as [[Wikipedia:Fork_(software_development)]], as we assume the closing parenthesis is not part of the link.
11924 - Added INTERLINKFORMAT; removed redundant SUPPRESSTOOLTIP; allow @ signs in page part of interwiki link; support single digit page part (TWiki:Main.PeterThoeny)
Internal changes: Use only official TWiki::Func Plugin API; for increased speed, moved Interwiki link handling from outsidePREHandler to startRenderingHandler
16 Feb 2004:
Support [[Site:Page][label]] Interwiki links (PTh); use TWiki::Func interface for I18N regular expressions (Walter Mundt)
18 Jan 2003:
Allow number sign # in Page name (PTh)
31 Aug 2002:
Allow percent sign % in page name (PTh)
27 Jul 2001:
Allow numbers 0-9 in site name
26 Jul 2001:
Fixed alternating missed link bug due to greedy $postfixPattern (fix by Richard Donkin)
14 Jul 2001:
Changed to plug & play
16 Jun 2001:
Made tooltips optional; prevent Module::Sub type of link
12 Jun 2001:
Added optional tool tips (IE only); added the link rules topic name variable; added flexible link patterns; optional $page in URL