External Link Plugin

This plugin adds a visual indicator to external links, so users can distinguish outgoing links from site links.

This will only work for forced links marked up using the so-called double bracket syntax, like:
[[http://external.site][an external site]] and [[http://external.site]]

URLs that are just written in as http://external.site are left untouched.

Syntax Rules

Remember to use the double bracket link syntax.

Plugin Settings

Change default settings in configure.
Configure setting Meaning Default
{MarkerImage} link marker image; see below for a list of images external.gif
{CheckCompletePage} If set to 1, disables the commonTagsHandler and uses a completePageHandler to check and stylize all external links on the page. 0
{Debug} If set to 1, writes debugging info to data/debug.txt 0

Marker images

Code text Image
%PUBURLPATH%/%SYSTEMWEB%/ExternalLinkPlugin/external.gif external.gif
%PUBURLPATH%/%SYSTEMWEB%/ExternalLinkPlugin/diagonal.gif diagonal.gif

CSS Classes

This plugin adds one CSS class:

.externalLink link class to mark outgoing links

IDN Considerations

International Domain Names allow use of the UNICODE character set in domain names. This enables a form of spoofing, where an alternate domain name is crafted with characters that appear like your local domain name, but lead to an external site.

Enabling the {CheckCompletePage} setting will check the generated HTML for all links on the page, and will stylize any external link on the page with the external link marker.

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.

Testing your installation

To test if the plugin is correctly installed, check the following links.

The links in the "If plugin enabled"-column should be marked with a marker if the plugin is functioning correctly.

Code text If plugin enabled
[[http://foswiki.org][foswiki.org]] foswiki.org
[[http://foswiki.org]] http://foswiki.org

Unsurprisingly, local links won't be marked as being external. The following links should not be marked:

Code text If plugin enabled
[[%ATTACHURL%/bli.png][link to (nonexistent) local attachment]] link to (nonexistent) local attachment

If you have enabled the {CheckCompletePage} option in the configuration, then the following html links will also be checked:
Code text If {CheckCompletelPage} enabled
<a href='http://foswiki.org'>foswiki.org</a> foswiki.org

But local links will not be marked external:
Code text If {CheckCompletelPage} enabled
<a href='https://damask2.mpie.de/pub/System/ProjectLogos/foswiki-badge.png'>logo</a> logo

Plugin Info

Authors: TWiki:Main.AurelioAHeckert, TWiki:Main.NelsonFerraz, TWiki:Main.AntonioTerceiro, Foswiki:Main.ArthurClemens
Change History:  
01 Aug 2015 v1.30 - Foswikitask:Item8446: Don't nest externalLink spans
Foswikitask:Item8563: Recognize short URLs as internal links.
Foswikitask:Item13590: Update for Foswiki 2.0, test with utf-8 international links. Check [<nop[...]] forced links to detect idn based spoofing attacks. Add optional completePageHandler to process all html links.
31 Dec 2009 v1.21 - fixed closing css declaration.
02 Oct 2009 v1.20 - Ported to Foswiki; changed img HTML tag to CSS style; moved plugin settings to Configure.
24 Apr 2006 v1.11 - %TOPIC% removed from =MARK definition, wasn't expanded correctly.
23 Apr 2006 v1.10 - Incorporated patch from TWiki:Main.TobiasRoeser (only mark external link once in an included scenario). Minor doc brush-up. Changed default marker to external.gif graphic. (TWiki:Main.SteffenPoulsen).
02 Nov 2005 v1.00 - Initial release

PackageForm edit

Author ProjectContributor
Version 1.30
Release 1.30
Repository https://github.com/foswiki/ExternalLinkPlugin
Copyright © 2005: Aurelio A Heckert, Nelson Ferraz, Antonio Terceiro; 2006: Steffen Poulsen; 2009: Foswiki:Main.ArthurClemens, 2015: Foswiki Contributors
License GPL (Gnu General Public License)
Home http://foswiki.org/Extensions/ExternalLinkPlugin
Support http://foswiki.org/Support/ExternalLinkPlugin
Topic attachments
I Attachment Action Size Date Who Comment
diagonal.gifgif diagonal.gif manage 63 bytes 02 Aug 2015 - 03:05 MartinDiehl  
external.gifgif external.gif manage 71 bytes 02 Aug 2015 - 03:05 MartinDiehl  
Topic revision: r7 - 02 Jun 2016, MartinDiehl
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding DAMASK? Send feedback