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 Support.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 WikiWord linking will occur.

If a topic is not found in the current web, this plugin will look in the LOOKELSEWHERE web list for that topic. If and when the topic is found as it looks through the webs in their listed order, it will create a link to that page using the [[ ]] syntax.

New Functionality
test case input output expected
found here WebHome WebHome WebHome
found singular here WebHomes WebHomes WebHomes
found elsewhere TWikiAdminGroup TWikiAdminGroup User.TWikiAdminGroup
found singular elsewhere TWikiAdminGroups TWikiAdminGroups User.TWikiAdminGroups

Don't break other types of links...
input output
FindElsewherePlugin#TopicAnchor FindElsewherePlugin#NewFunctionalityTest
TWiki.WebHome WebHome
WebHome WebHome
[[TWiki.WebHome]] TWiki.WebHome
[[Support.WikiWord]] Support.WikiWord
[[Support.WikiWords]] Support.WikiWords
Support.WikiWord WikiWord
Support.WikiWords WikiWords

FindElsewherePlugin Settings

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = If a topic isn't found in this web it will look in a predefined list of other webs and attempt to find it there.

  • List other webs in which to look for topics that don't exist
    • Set LOOKELSEWHERE = Main,User,Support,TWiki

  • If the WikiWord 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 PLURALTOSINGULAR = 1

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

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
data/TWiki/FindElsewherePlugin.txt,v Plugin topic repository
lib/TWiki/Plugins/FindElsewherePlugin.pm Plugin Perl module

Plugin Info

Plugin Author: MikeBarton
Plugin Version: 1 Feb 2002
Change History: 1 Feb 2002: Initial version
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.0
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/FindElsewherePlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/FindElsewherePluginDev

Related Topics: TWikiPreferences, TWikiPlugins, DefaultPlugin

-- MikeBarton - 1 Feb 2002

Navigation

%IFSKINSTATETHEN{searchbox="pos2"}%

%FISKINSTATE%
%MYSIDEBAR%

 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback