Skip navigation
noflyguy
Currently Being Moderated

Converting absolute links to relative links

Sep 1, 2009 8:25 AM

Using RH 7 HTML our corp wants to have help files able to function as "standalone" files on local PC's without network or server for business continuity. Presently most files have 150 or less topics and are published to a server. External files are in sub folders within the folder where the published file is located. Links to external attachments (.doc, .xls, .pdf, etc.) are absolute links and need to be changed to relative. An example existing link would be: HTTP://server.com/help/attachments/fname/sample.doc.  Help is the foler where tje published file is located and Attachments is the folder where the external files to be linked are located. When link is changed to: ../Attachments/  some links work and some don't. I discovered that some links require: ../../Attachments/ to function correctly. It appears that links that are not in the root path of the project manager require additional ../'s. I am trying to find out how RH7 reads the links and how to back out of a directory and when. Any help is appreciated. Thanks.

 
Replies
  • Currently Being Moderated
    Sep 1, 2009 11:08 AM   in reply to noflyguy

    Hi,

     

    You say that the files are stand alone, but that the files will be in a subfolder of your output. Does this mean that you can add the files as baggage files to your project, or is that impossible.

     

    About the ../ and ../../, it simply means take parent directory and take parent directory of parent directory. When you have a file in MyFile/Doc/Important/ and the topic is in MyFile/Robo, the path will be ../Doc/Important. When the topic is in the directory MyFile/Robo/Project, the path will be ../../Doc/Important. When you add the files as baggage files, you simply add a hyperlink to the file and let Robo sort out the hyperlink. If you can't attach the files as baggage files, you'll have to manually add all relative links. I can't think of an easy way to automate this. Altough a developer might be able to create a script for you.

     

    Greet,

     

    Willam

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 2, 2009 5:33 AM   in reply to Willam van Weelden

    The easiest, and most efficient, way is to replicate the folder environment onto your local machine (all folders and files exactly as they will appear in the destination area), and let RH do the heavy lifting.

     

    Therefore, to link to anything outside the current RH project, the method is:

     

    1. Select Link to: File in the Hyperlink dialog.
    2. When you select your link destination from the Select File dialog and click Open, the Link to: field initially displays the absolute path.
    3. Click OK.
    4. Now, double click the link to reopen the Hyperlink dialog; RH has magically transformed the link into a relative path.

     

    (You'll get an info message about linking to an external file...when you initially create the link and every time you open it...just ignore it.)

     

    We use this method in a 42-project merged project, and it's never failed us. The only time that your links will break is when you copy or move a file to another location. Since the relative paths are no longer valid, RH will automatically assign the links to within the current topic; you'll need to re-assign the link manually.

     

     

    Good luck,

    Leon

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 2, 2009 12:20 PM   in reply to noflyguy

    Yes, as long as you can identify each of the offending links in relation to your current project AND what the original link path was.

     

    In other words, not very likely. Sorry.

     

     

    Good luck,

    Leon

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points