Interwiki Plugin
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.
Link Syntax Rules
- 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.
Definition Syntax Rules
Add and edit aliases in
InterWikis.
- 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.
- The Tooltip Text must not contain:
- any HTML tags (including
<nop>
escape code)
- any internal WikiWord links
- any external links
- Hint: Escape
'WikiWords'
and '$page'
.
- If the link format override is provided, it overrides the
INTERWIKIPLUGIN_INTERLINKFORMAT
for just that entry.
Note that Interwiki links do not properly resolve when part of an INCLUDEd page name. e.g.
%INCLUDE{"Interwiki:link"}%
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_INTERLINKFORMAT |
Set the interlink format |
<a class="interwikiLink" href="$url" title="$tooltip" class="interwikiLink"><noautolink>$label</noautolink></a> |
INTERWIKIPLUGIN_RULESTOPIC |
The topic(s) containing the inter-wiki rules. Can be a comma separated list. See InterWikis for more details |
InterWikis |
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
If you have any problems, or if the extension isn't available in
configure
, then you can still install manually from the command-line. See
https://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Change History