The foswiki svn repository is obsolete. Developers should register for a http://github.com/ account for commit access to foswiki project. Github is ready for updates.

AliasPlugin

Description

This plugin allows you to create arbitrary word aliases. If you write down a word that has a defined alias, it will then be replaced with the given text string. If that string is a string of the format <web>.<topic> it will be replaced by an appropriate link.

Configuration

Configuration of this plugin is done by writing your aliases into a specific topic, the WebAliases defining the WebAliases for the current web. Site-wide aliases can be defined in SiteAliases. Definitions are looked up in the given order:

  1. current topic
  2. current web's WebAliases
  3. Main.SiteAliases

Aliases are applied when saving a topic. The original form is encoded together with the replacement. The reverse operation is done before editing the topic.

Syntax

This is the list of tags defined by this plugin.
Name Description
%ALIASES% display all aliases
%ALIASES{regex="on"}% display also the regular expression to match the alias
%ALIASES{"<topic>" merge="on,off"}% use aliases defined in <topic> by either merging or redefining the set of current aliases
%ALIAS{name="..." value="..." [regex="..."]}% defines an alias using regex to find it; if regex is not specified it defaults to the alias' name
%UNALIAS% delete all aliases
%UNALIAS{name="..."}%,%UNALIAS{"..."}% deletes one alias

The regex parameter in the %ALIAS{...}% tag might contain the two variables $start and $stop that help to match the boundaries of an alias consisting of non-alphabetic characters. Some textile examples:

%STARTSECTION{"textile"}%
%ALIAS{name="''" regex="$start''$stop" value="&rdquo;"}%
%ALIAS{name="``" regex="$start``$stop" value="&ldquo;"}%
%ALIAS{name="--" regex=" -- " value=" &mdash; "}%
%ALIAS{name="(c)" regex="$start\(c\)$stop" value="&copy;"}%
%ALIAS{name="(r)" regex="$start\(r\)$stop" value="&reg;"}%
%ALIAS{name="(tm)" regex="$start\(tm\)$stop" value="&trade;"}%
%ALIAS{name="..." regex="$start\.\.\.$stop" value="&hellip;"}%
%ALIAS{name=",," regex="$start,,$stop" value="&bdquo;"}%
%ALIAS{name="1/2" regex="$start1/2$stop" value="&frac12;"}%
%ALIAS{name="1/4" regex="$start1/4$stop" value="&frac14;"}%
%ALIAS{name="3/4" regex="$start3/4$stop" value="&frac34;"}%
%ENDSECTION{"textile"}%

Defined Aliases

%ALIAS{name="TESTLINK" value="System.WebHome"}% %ALIAS{name="TESTALIAS" value="yes"}% %ALIAS{name="rtfm" value="read the fine manual"}% %ALIASES%

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.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "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 http://foswiki.org/Support/ManuallyInstallingExtensions for more help.

Plugin Info

Plugin Author: Othello Maurer, Michael Daum
Copyright ©: 2003, Othello Maurer; 2003-2014, Michael Daum http://michaeldaumconsulting.com
License: GPL (GNU General Public License)
Release: 3.04
Version: 3.04
Change History:  
25 Aug 2011: minor compatibility fixes
09 Nov 2010: fixing error using takOutBlocks
07 Jun 2010: don't expand ADDTOZONE/ADDTOHEAD when parsing in alias definitions
12 Feb 2010: compatibility with newer foswiki engines
17 Nov 2009: complete rewrite not to apply aliases during view but during save
17 Apr 2009: converted to Foswiki plugin
28 Apr 2008: speed improvements
13 Nov 2007: Item4959: disabled settings in plugin topic, removed DEFAULT_ALIASES
14 Sep 2007: added view.alias.tmpl
13 Sep 2007: rewrite for modern wiki engines
10 Feb 2006: fixed use of uninitialized value (outch)
03 Feb 2006: prevent nested alias expansion; support convenience aliases for anchors on the same page
09 Dec 2005: added expl icite regex parameter for ALIAS
06 Dec 2005: fixed deprecation warning on a dakar install; added support for non-alphabetical aliases; fixed use of uninitialized values due to special chars in alias patterns; the ALIAS tag in WebAliases can be used to define global aliases now
27 Apr 2005: always read site aliases and then merge in web aliases
07 Apr 2005: Foswiki:Main/MichaelDaum: major rewrite
30 Mar 2005: Foswiki:Main/MichaelDaum: added alias area
  added fix to honor order of alias/unalias commands in a topic
23 Mar 2005: Foswiki:Main/MichaelDaum: added list of test-cases
  rewrite of substitution code
  improved configurability
22 Mar 2005: Foswiki:Main/MichaelDaum: prevent substitutions within html tags, wiki tags and links
21 Mar 2005: Foswiki:Main/MichaelDaum: allow arbitrary string substs
  configured via a list now (was tables)
  taking care not to replace inside html tags
1 Dec 2003: Foswiki:Main.NielsKoldso: Non WikiWord aliases as an option
  More alias prefixes allowed
16 Oct 2003: Speedup
09 Oct 2003: Initial Version
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Home: Foswiki:Extensions/AliasPlugin
Support: Foswiki:Support/AliasPlugin
Topic attachments
I Attachment Action Size Date Who Comment
AliasPlugin.md5md5 AliasPlugin.md5 manage 0.2 K 23 Apr 2014 - 08:12 MichaelDaum  
AliasPlugin.sha1sha1 AliasPlugin.sha1 manage 0.2 K 23 Apr 2014 - 08:12 MichaelDaum  
AliasPlugin.tgztgz AliasPlugin.tgz manage 7.4 K 23 Apr 2014 - 08:11 MichaelDaum  
AliasPlugin.zipzip AliasPlugin.zip manage 9.4 K 23 Apr 2014 - 08:11 MichaelDaum  
AliasPlugin_installerEXT AliasPlugin_installer manage 4.2 K 23 Apr 2014 - 08:12 MichaelDaum  
Topic revision: r13 - 23 Apr 2014, MichaelDaum
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License