Tags:
create new tag
view all tags

Question

When I use the PublishWebPlugin everything works fine with no errors. The HTML goes in the right dir (/twiki/dumps) and so do the attachments (/twiki/dumps/attach). The only thing is that the links to the attachments in the generated HTML are all wrong ("http://myhostname/attach/file.name" instead of just "attach/file.name"). I've gone through all the .cfg files and read everything I could find on the plugin but no-one else seems to be having the same problem. Thanks in advance for your help.

Environment

TWiki version: TWikiRelease04x00x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin, PublishWebPlugin
Server OS: Windows 2000
Web server: Apache 1.3
Perl version: Cygwin perl 5.8.7
Client OS: Windows 2000
Web Browser: Internet Explorer 6, Mozilla 1.7.5, Opera 8.52
Categories: Plugins

-- TWikiGuest - 01 Mar 2006

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

It is possible that there is a bug in the PublishWebPlugin, I will investigate when I find time.

-- PeterThoeny - 02 Mar 2006

I think that the problem is caused by the way TWiki handles links. There's an old discussion on it here:

http://twiki.org/cgi-bin/view/Codev/WhyBaseTag

If I use a skin that doesn't have the <BASE> tag defined in it, it causes the links to other web pages to be less problematic because the browser doesn't stick the base URL in front of every link. The images are still linked in the same way described above; the page links are absolute UNIX paths which is also incorrect, plus they don't have the ".html" bit at the end - they're still TWiki-style links. I gather nothing resulted from the discussion about moving TWiki to relative links?

Possible partial answer:

Adding the "+" line below after the three lines before it in PublishWebPlugin.pm removes the problematic part of the path.

      my $pubUrl = TWiki::Func::getPubUrlPath();
      $tmpl =~ s/($pubUrl)\/([^\)'" ]+)/&fixAndCopyAttachments($1, $2, $pubDir )/geo;
      $tmpl =~ s/<\/?(nop|noautolink)\/?>\n?//gois;
+     $tmpl =~ s!https?://[^/ "'\)]+/_attach/!/_attach/!gois;

-- WolfgangSlany - 08 Sep 2006

Thanks for the update, noted in PublishWebPluginDev.

-- PeterThoeny - 08 Sep 2006

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2006-12-24 - PeterThoeny
 
  • 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.