5 Replies Latest reply on Sep 2, 2009 12:20 PM by MergeThis

    Converting absolute links to relative links


      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.

        • 1. Re: Converting absolute links to relative links
          Willam van Weelden Adobe Community Professional & MVP



          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.





          1 person found this helpful
          • 2. Re: Converting absolute links to relative links
            MergeThis Level 4

            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,


            • 3. Re: Converting absolute links to relative links
              noflyguy Level 1

              This is a good solution for the future, but is there a way to use Multi-file find and replace to convert current absolute paths to relative? Thanks.

              • 4. Re: Converting absolute links to relative links
                noflyguy Level 1

                Thank you for your help.

                • 5. Re: Converting absolute links to relative links
                  MergeThis Level 4

                  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,


                  1 person found this helpful