OpenNTF.org - DominoWiki

My Links (Not logged in)
User Name Password
Hosted by Prominic.NET

   Project: DominoWiki (Managed by Benedict R Poole)
Actions:


Response
SubjectFix for this issue
Created 02/05/2007 10:21 AM by Steven Searson.
Modified<none> by <none>.
Body

One of our customers (NYK Line) have implemented DominoWiki and came across this same issue. I've had a delve into the code and found a solution:

If you open the WikiPage.class script library and replace the Function fixRelativeLinks with this code, the issue should be resolved. This uses the domino database path when generating links, rather than just a reference to the page you are on.

Private Function fixRelativeLinks (Byval txt As String) As String
'** convert relative links in <a> and <img> tags to
'** "pagename/$file/filename" format, so attached files and
'** images are referenced properly
Dim srcStart As String, srcEnd As String
srcStart = |<img src="|
srcEnd = |">|
fixRelativeLinks = ReplaceRangeEnds(txt, _
srcStart, srcEnd, _
srcStart & "/" & dbPath & "/pages/" & Me.Subject & "/$file/", srcEnd, "*[/]*", False)

Dim hrefStart As String, hrefEnd As String
hrefStart = |<a href="|
hrefEnd = |">|
fixRelativeLinks = ReplaceRangeEnds(fixRelativeLinks, _
hrefStart, hrefEnd, _
hrefStart & "/" & dbPath & "/pages/" & Me.Subject & "/$file/", hrefEnd, "*[/]*", False)
End Function