Feature Proposal: Specify list of internal link domains that is excluded from the "external links" rendering
Motivation
In federated sites where twiki servers are distributed across multiple physical regions, there can be multiple server names that construct a federation. For example,
twiki1.example.com,
twiki2.example.com, and
twiki3.example.com may be a federated group of servers, whose twiki contents are synchronized. In that senario, any URLs of a different server but in the same federation should not be converted into "external links", which are opened in a new window, while all the other normal external links should be opened in a new window. Particularly the issue can occur when %SCRIPTURL% is used to point to a master location rather than the current server.
Description and Documentation
If an internal domain pattern can be configured (e.g.
$TWiki::cfg{Links}{InternalLinkDomains} in the same format as
SsoForwardCookiePlugin), it can provide a generic method to define what server names should be considered internal.
(Added 2013-03-19)
With some feedback from early adopters of our internal upgrades, we have found that the external links require more controls under each web level:
| Site Config |
WebPreferences |
| $TWiki::cfg{Links}{ExternalLinksInNewWindow} = 1 |
Set EXTERNALLINKSINNEWWINDOW = on |
| $TWiki::cfg{Links}{ExternalLinksIcon} = 1 |
Set EXTERNALLINKSICON = on |
| $TWiki::cfg{Links}{InternalLinkDomains} = '' |
Set INTERNALLINKDOMAINS = ... |
The value of
InternalLinkDomains is expected to be a comma-separated list of domains or "topic:[WebName.]TopicName" format, where the topic should contain a table with the left-most column set to domains.
Each domain name entry can be:
- A single dot "." - indicating any "one-word" domain name (typically used in intranet)
- A domain name starting with a "." - indicating subdomains (e.g. if ".example.com" is specified, it represents any subdomains such as "foo.example.com", but does not include "example.com" itself)
- A proper domain name - indicating the domain itself, not including any subdomains.
--
Mahiro Ando - 2013-03-18
Examples
Impact
Implementation
--
Contributors:
Mahiro Ando - 2013-03-12
Discussion
Sensible enhancement.
--
Peter Thoeny - 2013-03-12
Thanks Peter for the feedback. I have edited the description a bit, so I can use the same idea as
SsoForwardCookiePlugin on how to specify domains.
--
Mahiro Ando - 2013-03-13
Just added some documentation to extend the external link configurations to preferences variables. Also,
InternalDomains might be a little ambiguous, so it should be renamed to
InternalLinkDomains.
--
Mahiro Ando - 2013-03-19