Find Elsewhere Plugin
This plugin will automatically link to another web(s) if a topic isn't found in the current web.
This is useful for a TWiki site that wants to implement a glossar/dictionary web where common terms are defined and stored. Without this plugin:
- Each web would need to create their own topic for a common term
- Link to or INCLUDE the topic from where it is defined
- Authors need to remember to put the Web name in front of the topic name, such as TWiki.WikiWord
Without this kind of plugin, it's likely that common terms used within an organization will be defined in multiple webs or the common terms will be unlinked wiki words (as if they didn't exist).
Syntax Rules
No new rules are introduced. However, new automatic
Wiki Word linking will occur.
If a topic is not found in the current web, this plugin will look through the webs listed in the LOOKELSEWHEREWEBS variable. If the topic is found (as it looks through the webs in their listed order), it will create one or more links, depending on the number of topics found.
New functionality, single hit
| Test case | Input | Output (if installed) | Expected |
| Found here | WebHome | Web Home | Web Home |
| Found singular here | WebHomes | Web Homes | WebHomes |
| Found elsewhere | TWikiAdminGroup | T Wiki Admin Group? | TWikiAdminGroup |
| Found singular elsewhere | TWikiAdminGroups | T Wiki Admin Groups? | TWikiAdminGroups |
| Found elsewhere, spaced wiki word | [[TWiki admin group]] | TWiki admin group? | TWiki admin group |
| Found elsewhere, abbrev | ACRONYM | ACRONYM | (If ACRONYM is a topic defined in one of the LOOKELSEWHERE webs, a link to it should show up) |
| Escaped with <noautolink> | <noautolink> TWikiAdminGroup </noautolink> | TWikiAdminGroup | TWikiAdminGroup (Note: FindElsewherePlugin doesn't support <noautolink> in Cairo; TWikiAdminGroup will be found anyway if you're in this codebase) |
New functionality, multiple hits
If a word is found in two or more LOOKELSEWHERE webs, a special syntax is used:
- Standard WikiWord: TWikiPreferences(TWiki,Main)
- [[Spaced wiki word]]: TWiki preferences(TWiki,Main)
Create this table in
Sandbox.FindElsewherePluginTest? to try it out:
| *Test case* | *Input* | *Output<br/>(if installed)* | *Expected* |
| Found elsewhere | <nop>TWikiPreferences | TWikiPreferences | <nop/>TWikiPreferences<sup>([[%TWIKIWEB%.TWikiPreferences][%TWIKIWEB%]],[[%MAINWEB%.TWikiPreferences][%MAINWEB%]])</sup> |
| Found elsewhere, spaced wiki word | [<nop/>[TWiki preferences]] | [[TWiki preferences]] | <em>TWiki preferences</em><sup>([[%TWIKIWEB%.TWikiPreferences][%TWIKIWEB%]],[[%MAINWEB%.TWikiPreferences][%MAINWEB%]])</sup> |
Internationalization
FindElsewherePlugin handles international characters (I18N) in links, topics and webs.
Don't break other types of links
FindElsewherePlugin Hints
- You can en- or disable this plugin for webs, topics or users, using the standard TWiki preferences hierarchy
- You can avoid single words being looked up by using
!DontLookup or <nop/>DontLookup syntax
- "Groups of webs" can use each other as lookup webs, by setting the LOOKELSEWHEREWEBS variable accordingly in their WebPreferences.
FindElsewherePlugin Settings
- One line description, is shown in the Text Formatting Rules topic:
- Set SHORTDESCRIPTION = Create links by looking first in the current web, then in a predefined list of other webs
- Disable look elsewhere - sitewide (here), per web (in WebPreferences) or pr. topic
- Set DISABLELOOKELSEWHERE = 0
- List other webs in which to look for topics that don't exist in the current web
- Set LOOKELSEWHEREWEBS = TWiki, Main
- If the Wiki Word is plural but doesn't exist, also look for the singular word. Note this setting is for looking in other webs only (plural to singular is still automatically done in the current web).
- Set DISABLEPLURALTOSINGULAR = 0
- Debug plugin: (See output in
data/debug.txt)
Plugin Installation Instructions
- Download the ZIP file from the Plugin web (see below)
- Unzip
FindElsewherePlugin.zip in your twiki installation directory. Content:
| File: | Description: |
data/TWiki/FindElsewherePlugin.txt | Plugin topic |
lib/TWiki/Plugins/FindElsewherePlugin.pm | Plugin Perl module |
Plugin Info
Related Topics: T Wiki Preferences,
T Wiki Plugins,
Default Plugin
--
TWiki:Main.MikeBarton - 1 Feb 2002