7 Replies Latest reply on Mar 12, 2009 10:56 AM by Pete Lees

    Is it possible to have dynamic variables?

      Hi all,

      I'm new to RoboHelp. I'm trying to determine if this software could work for my company's needs. One thing that I cannot find in the help is dynamic variables. I need to be able to feed a variable into the generated html help file, which will then affect the path of the links in the help file. Is such a thing possible? If there are no dynamic variables, can I achieve this result through a different method?

      thanks so much!
        • 1. Re: Is it possible to have dynamic variables?
          RoboColum(n) Level 5
          Hi Ellen and welcome to the RH community.

          Can you tell what you are trying to achieve by this dynamic variable path?

          • 2. Re: Is it possible to have dynamic variables?
            EllenDrommond Level 1
            Hi Colum,
            Here is what I'm trying to do:
            1. In the final help file, there are numerous links to product pages, tutorials, etc.
            2. Depending on where the customer is coming from, these links change.
            3. I wanted to save the "customer location" if you will, as a variable
            4. create another variable, call it path, that truncates or massages "customer location"
            5. use the variable "path" in the actual links

            Problem is, I don't know "customer location" until they actually click to open the help file. Hence, I was thinking about dynamic variables...

            Does that make any sense?

            thanks so much for helping me
            • 3. Re: Is it possible to have dynamic variables?
              RoboColum(n) Level 5
              Thanks for the additional info Ellen. I see where you are coming from but I can't see anyway you can achieve this with RoboHelp or any other HAT. Links to a page or tutorial can be either relative or absolute, but if the physical location of these changes anytime after the link is defined you'll get broken links.

              Are the links to pages outside of your help? Are they always in the same location or do they also change? Indeed could they always be in the same location. If they could, you's be able to link to them fairly easily.
              • 4. Re: Is it possible to have dynamic variables?
                EllenDrommond Level 1
                Hi Colum,

                The actual location of the tutorials or pages does not change. I always have the relative location, it's the root that I don't have.

                Depending on where the client is coming from, he sees a slightly different content in a tutorial with the same relative link. For example:


                the full relative link after the location is the same, but shows different content depending on whether the customer is coming from location1 or location2.

                I wanted to somehow be able to read that information into the help file.

                So, you say it's not possible? Dang...
                • 5. Re: Is it possible to have dynamic variables?
                  MergeThis Level 4
                  You could use conditional build tags to generate different output for each of the locations.

                  Good luck,
                  • 6. Re: Is it possible to have dynamic variables?
                    If you want to use conditional tags it would mean that you would have to apply them to show different URLs on different output CHM files for each case and I guess you want it all on the same CHM.

                    If you want to do that, you can replace those URLs with a shortcut to a redirector file which redirects users to different URLs depending on where they are coming from. You could link your CHM to the redirector file, but of course Robohelp cannot make the redirector file for you. I suggest you ask your IT or development department...
                    • 7. Re: Is it possible to have dynamic variables?
                      Pete Lees Level 2
                      Hi, Ellen,

                      Is this WebHelp that you're planning to develop, and not compiled HTML Help (.chm)?

                      If the former, I think you should be able to achieve what you want by using JavaScript to construct the hyperlinks dynamically. For example, using the location.host property, you can get the host portion of the current URL ("www.location1.com"). Then you can append the rest of the URL to it.

                      I've attached some (untested) script that may give you some ideas.

                      For compiled HTML Help, there may be some mileage in using the techniques illustrated in Scott Prentice's "CUD (ChmUpDate) Files" sample, available here:


                      This allows you to read into a .chm file some text strings that are defined in an external file. It's possible that your software developers can manipulate the contents of this file programmatically in order to, for example, add the customer's location to it. Then you can use the techniques illustrated in the sample file to include the location in your hyperlinks.