Tags:
create new tag
view all tags
I am setting up TWiki on an intranet Server and would like to use Specific Links with relative URI like [[/mirror/internic/rfc-index.html][RFC Index]]. To make this possible I modified TWiki.pm. See appended patch. Any comments?

===================================================================
RCS file: TWiki.pm,v
retrieving revision 1.1
diff -c -r1.1 TWiki.pm
*** TWiki.pm    2002/02/15 16:27:27     1.1
--- TWiki.pm    2002/02/15 16:36:17
***************
*** 1797,1804 ****
      $theLink =~ s/^\s*//o;
      $theLink =~ s/\s*$//o;
  
!     if( $theLink =~ /^(http|ftp|gopher|news|file|https)\:/ ) {
!         # found external link
          return "$thePreamble<a href=\"$theLink\" target=\"_top\">$theText";
      }
  
--- 1797,1804 ----
      $theLink =~ s/^\s*//o;
      $theLink =~ s/\s*$//o;
  
!     if( $theLink =~ /^((http|ftp|gopher|news|file|https)\:)|\/\w/ ) {
!         # found external or relative abs_path link
          return "$thePreamble<a href=\"$theLink\" target=\"_top\">$theText";
      }

-- WinfriedKoenig - 15 Feb 2002

Sounds like a useful enhancement. Any unwanted side effects?

-- PeterThoeny - 16 Feb 2002

This does look useful. If this is going into the core code, could we also consider the EasierExternalLinking feature, which makes it possible to link to URLs using something like this: [[http://example.com click here]] or [[/path/to/some/file click here]] - i.e. it avoids the hard-to-type ][ combination in the middle. We've been using this on our local TWiki for some months now and it works well.

-- RichardDonkin - 16 Feb 2002

I support RichardDonkin: URL cannot contain space, so we can use space to separate URL from text of the link inside [[]]. Users will appreciate this, and I hope it is simple change.

-- PeterMasiar - 19 Feb 2002

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2002-02-19 - PeterMasiar
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.