Tags:
linking1Add my vote for this tag navigation1Add my vote for this tag create new tag
, view all tags

Find Elsewhere Plugin

Automatically link to topic in other web(s) if it isn't found in the current web

Introduction

This plugin is useful - for example - for a TWiki site that wants to implement a glossary/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
  • Or need to link to or INCLUDE the topic from where it is defined
  • Authors would need to remember to put the Web name in front of the topic name, such as TWiki06x00.WikiWord

Without this kind of plugin, it's likely that common terms or acronyms (abbreviations) used within an organization would be defined in multiple webs or the common terms will be unlinked wiki words (as if they didn't exist).

Syntax Rules

No new syntax is introduced. However, new automatic WikiWord linking will occur.

If a topic or abbreviation 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.

Single hits

Test case Input Output
(if installed)
Expected
Found here WebHome WebHome TWiki06x00
Found singular here WebHomes WebHomes WebHomes
Found elsewhere WebSearch WebSearch WebSearch
Found elsewhere (LOOKELSEWHEREFORLOCAL enabled) TWiki06x00.TWikiUsers TWikiUsers TWikiUsers
Found elsewhere (LOOKELSEWHEREFORLOCAL disabled) TWiki06x00.TWikiUsers TWikiUsers TWikiUsers (non-existing)
Found elsewhere [[TWikiAdminGroup][twiki admins]] twiki admins twiki admins
Don't touch direct links [[Main.TWikiAdminGroup][twiki admins]] twiki admins twiki admins
Found singular elsewhere WebSearches WebSearches WebSearches
Found elsewhere, spaced wiki word [[Web search]] Web search Web search
Found elsewhere, abbrev ACRONYM ACRONYM (If ACRONYM is a topic defined in one of the LOOKELSEWHERE webs, a link to it should show up)
Found elsewhere, abbrev w. alt. linktext [[ACRONYM][acronym link text]] acronym link text (If ACRONYM is a topic defined in one of the LOOKELSEWHERE webs, a link to it should show up)
Escaped with <noautolink> <noautolink> WebSearch </noautolink> WebSearch WebSearch

(Note: FindElsewherePlugin doesn't support <noautolink> in TWiki-3; WebSearch will be found anyway if you're still using this codebase) |

Multiple hits

If a word is found in two or more LOOKELSEWHERE webs, a special syntax is used:

Create this table in Sandbox.FindElsewherePluginTest to try it out (use raw edit when pasting):

| *Test case* | *Input* | *Output<br />(if installed)* | *Expected* |
| Found elsewhere, spaced wiki word | [<nop>[TWiki preferences]] | [[TWiki preferences]] | _TWiki preferences_ <sup>([[%SYSTEMWEB%.TWikiPreferences][%SYSTEMWEB%]],[[%USERSWEB%.TWikiPreferences][%USERSWEB%]])</sup> |
| Found elsewhere | <nop>TWikiContributor | TWikiContributor | <nop>TWikiContributor<sup>([[%SYSTEMWEB%.TWikiContributor][%SYSTEMWEB%]],[[%USERSWEB%.TWikiContributor][%USERSWEB%]])</sup> |

Internationalization

FindElsewherePlugin handles international characters (I18N) in links, topics and webs.

Compatibility

Input Output
FindElsewherePlugin#TopicAnchor FindElsewherePlugin#NewFunctionalityTest
TWiki06x00.WebHome TWiki06x00
WebHome WebHome
[[TWiki06x00.WebHome]] TWiki06x00.WebHome
[[TWiki06x00.WikiWord]] TWiki06x00.WikiWord
[[TWiki06x00.WikiWords]] TWiki06x00.WikiWords
TWiki06x00.WikiWord WikiWord
TWiki06x00.WikiWords WikiWords
[[Main.WebSearch][This is a link to WebSearch in Main]] This is a link to WebSearch in Main

FindElsewherePlugin Hints

  • You can enable 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

Enabling and disabling the plugin globally

You can enable or disable the FindElsewherePlugin plugin sitewide (in TWikiPreferences), per web (in WebPreferences) or pr. topic by defining DISABLELOOKELSEWHERE = 1.

Scope of the plugin - webs to find topics in

You can list other webs in which to look for topics that don't exist in the current web by defining LOOKELSEWHEREWEBS to be a comma-separated list of webs - for example, TWiki,Main

Singular and plural topics

If the WikiWord is plural but doesn't exist, FindElsewherePlugin also looks for the singular word in other webs. You can disable this behaviour by setting DISABLEPLURALTOSINGULAR = 1. (Note this setting is for looking in other webs only (plural to singular is still automatically done in the current web, dependent on the setting in configure).

ACRONYM link settings

A setting called "LOOKELSEWHEREFORACRONYMS" can be set to a value of none, first or all (all is default).

none means that non-forced acronyms in topics are never found elsewhere, first that they are linked only at the first occurence and all that every occurence is linked. Especially topics with many occurences of the same acronym will experience improved readability by use of the first setting.

Overriding forced local links

Even if a link refers explicitly to the current web and a topic name (for example, [[Thatweb.ThatTopic]], you can still trigger FindElsewherePlugin to look in other webs for that topic. To enable this behaviour for a web, define LOOKELSEWHEREFORLOCAL = 1 in the WebPreferences. This is particular useful when you have moved topics from one web to another, but you don't want to rewrite all the links in the source web.

Enabled for demo and testing - try it on and off

  • Set LOOKELSEWHEREFORLOCAL = 1

Plugin 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 where TWiki is running.

Like many other TWiki extensions, this module is shipped with a fully automatic installer script written using the BuildContrib.

  • If you have TWiki 4.2 or later, you can install from the configure interface (Go to Plugins->Find More Extensions)
  • If you have any problems, then you can still install manually from the command-line:
    1. Download one of the .zip or .tgz archives
    2. Unpack the archive in the root directory of your TWiki installation.
    3. Run the installer script ( perl <module>_installer )
    4. Run configure and enable the module, if it is a plugin.
    5. Repeat for any missing dependencies.
  • If you are still having problems, then instead of running the installer script:
    1. Make sure that the file permissions allow the webserver user to access all files.
    2. Check in any installed files that have existing ,v files in your existing install (take care not to lock the files when you check in)
    3. Manually edit LocalSite.cfg to set any configuration variables.

Plugin Info

Plugin Author: TWiki:Main.MikeBarton
Copyright: © 2002 TWiki:Main.MikeBarton,
© 2002-2011 TWiki:TWiki.TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 21525 (2011-06-16)
Change History:  
2011-06-16: TWikibug:Item6725: Change global package variables from "use vars" to "our" -- TWiki:Main.PeterThoeny
2011-06-16: TWikibug:Item6753: Fix for plugin failing on Specific Links [[WikiWord][displayed reference]] when WikiWord doesn't exist -- TWiki:Main.JohnRouillard
2010-08-06: TWikibug:Item6530 - doc enhancements; changing TWIKIWEB to SYSTEMWEB -- TWiki:Main.PeterThoeny
19 Dec 2007: TWiki:Main.SteffenPoulsen - Link none, first or all standalone abbreviations (LOOKELSEWHEREFORACRONYMS option added)
18 Dec 2007: TWiki:Main.SteffenPoulsen - Abbrev with alternative linktext found elsewhere again
25 Sep 2007: TWiki:Main.CrawfordCurrie - Added redirect support, removed illegal calls, and made more efficient
20-Apr-2006: (v1.9) - Now repects <noautolink> ... </noautolink> blocks (Dakar only) and a new NOAUTOLINK preference flag - TWiki:Main.MichaelDaum
07-Apr-2006: (v1.8) - Replaced direct usage of %regex with TWiki::Func::getRegularExpression(), replaced some implicit scalar references with explicit $ notation - TWiki:Main.ScottHunter
08 Apr 2005: (v1.7) - Negated vars DISABLELOOKELSEWHERE and DISABLEPLURALTOSINGULAR can now be set per web (WebPreferences) or per topic. - TWiki:Main.SteffenPoulsen
05 Apr 2005: (v1.6) - Bugfix: Preambles for ACRONYMS were doubled. - TWiki:Main.SteffenPoulsen
04 Apr 2005: (v1.5) - Plugin less greedy - now leaves linktext in [[WikiWord][long links with ACRONYMS or WikiWords]] alone - TWiki:Main.SteffenPoulsen
03 Apr 2005: (v1.4) - Documentation update. - TWiki:Main.SteffenPoulsen
02 Apr 2005: (v1.3) - I18N-support added. New link style. TWiki:Codev.WebNameAsWikiName supported - TWiki:Main.SteffenPoulsen
12-Feb-2004: Matt Wilkie - put all of above into twikiplugins cvs, - removed "/o"'s as there may be issues with modperl (TWiki:Codev.ModPerl)
25-May-2003: Martin Cleaver - patch to add TWiki:Codev.WebNameAsWikiName (cvs rev1.4)
25-Sep-2002: TWiki:Main.PeterHErnst - modified webname to show as superscript, - some other changes (chiefly "/o" regex modifiers) (cvs rev1.3)
15-May-2002: Marco Carnut - patch to show webname, e.g. Main.WebHome (cvs rev1.2)
01 Feb 2002: Initial version
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/FindElsewherePlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/FindElsewherePluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/FindElsewherePluginAppraisal

Related Topics: TWikiPlugins, UserDocumentationCategory, AdminDocumentationCategory

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 FindElsewherePlugin.md5 r6 r5 r4 r3 r2 manage 0.2 K 2011-06-17 - 05:07 PeterThoeny  
Compressed Zip archivetgz FindElsewherePlugin.tgz r6 r5 r4 r3 r2 manage 9.5 K 2011-06-17 - 05:07 PeterThoeny  
Compressed Zip archivezip FindElsewherePlugin.zip r16 r15 r14 r13 r12 manage 12.4 K 2011-06-17 - 05:07 PeterThoeny  
Unknown file formatEXT FindElsewherePlugin_installer r3 r2 r1 manage 3.4 K 2011-06-17 - 05:07 PeterThoeny  
Edit | Attach | Watch | Print version | History: r31 < r30 < r29 < r28 < r27 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r31 - 2013-10-16 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2016 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.