Question
I cannot find any hints on how to open a link with the "[[...][...]]" notation in a new browser window. How can I do that?
Regards,
Chris
- TWiki version: Dec2001
- Perl version: 5.8.0
- Web server & version: Apache 2.0.40
- Server OS: RedHat 8.0
- Web browser & version: Mozilla 1.2.1
- Client OS: Windows XP, RH 8.0
--
ChristianSchlaefcke - 06 Jan 2003
Answer
In most browsers, you just hold down the shift key and click the link. This isn't a TWiki issue, of course, unless you want to force the link to always open in a new window - in which case, you'll probably need a javascript: type URL (see
Google:Telnet+URL+TWiki
), and to customise
CVS:lib/TWiki.pm
.
--
RichardDonkin - 06 Jan 2003
Christian: As Richard says, this is not really a TWiki question. But since you are using Mozilla, a middle click on the link should open the link in a new window.
But try out the tabbed browsing in Mozilla if you are not familiar with it. First configure using Edit->Preferences->Tabbed Browsing->Load links in background AND Open Tabs instead of Windows for middle click. Then middle-click away on any links in a page and it opens them all in new tabs listed across the top of the screen with the current page still active and on top. Very nice feature - the best way to browse TWiki
--
MartinWatt - 06 Jan 2003
Question (2)
My version of
ChristianSchlaefckes question is: How can I add options like TARGET to "[[...][...]]" notation. E.g. "[[http://my.url TARGET="myTarget"][Link]]"?
--
FrankThommen - 07 Jan 2003
This is not currently possible, but you should be able to add a suitable rule to the
DefaultPlugin - see the last function in
CVS:lib/TWiki.pm
, which has the rule for external linking, you can just copy this, inventing a suitable syntax if needed.
For example, using the
EasierExternalLinking format (easier to type IMO), you could do something like this (based on the TWiki.pm code, would need changes to use in plugin so this is only a guide):
# Codev.OpenLinkInNewBrowserWindow
# '[[URL#anchor!target display text]]' link:
s/\[\[([a-z]+\:\S+?)!([a-z0-9_]+)\s+(.*?)\]\]/&altSpecificLink("",$theWeb,$theTopic,$3,$1,$2)/ge;
I've added a non-greedy '?' suffix to the \S+ part, so that the URL+anchor part should only match up to the '!' - the target is matched into $2, and passed as an extra parameter to the altSpecificLink subroutine. This is
not tested, of course, and altSpecificLink would need to be written, along the lines of the specificLink routine.
It would be good to have a standard way of doing extended link features, but ultimately you can always just use A HREF links...
--
RichardDonkin - 07 Jan 2003