3 Replies Latest reply on May 30, 2008 4:37 AM by Peter Grainge

    Variables do not work with topic titles


      There seems to be a bug/limitation with variables in topic titles. Inserting them in the TOC works fine. The topic title in the TOC is displayed correctly. However, if you perform a search, all topics that contain a variable in the title are incorrectly displayed in the results--all text up to and including the variable is cut off.

      You cannot (as far as I can see) insert variables for topic titles using the RoboHelp GUI. That is--unlike in the TOC--you cannot select Properties for a topic and insert a variable in the Topic Title (in the TOC it is called the Page Title). The way I inserted variables in my project (was one I upgraded from X5 to RH7) was via a search & replace operation for all *.htm files. This included replacing the HTML head <title></title> entry. For example:

      Before: <title>What is an invoice profile?</title>
      After: <title>What is <uservariable name=Document_type1 x-showvalue x-value="an invoice">an invoice</uservariable> profile?</title>

      When I search for this topic, the search result is just profile? This problem applies to all topic titles that contain variables.

      It seems as though variables in topic titles are not supported by RoboHelp, which is a major limitation of this feature. My project contains lots of variables in the topic titles, which renders topic searches useless, as the search result list is comprised mostly of cut-off and incomprehensible titles.

      Anyone else have the same problem? Is there a workaround?
        • 1. Re: Variables do not work with topic titles
          Peter Grainge Adobe Community Professional (Moderator)
          Welcome to the forum

          There is a problem here but I am not seeing quite the same as you.

          Open the supplied Customer Care project and go to the topic Auto Loans.

          Note the Topic Title in Properties is Auto Loans but in the topic the heading is a variable.

          Now generate the WebHelp UK output and search on Car Loans.

          You will see Auto Loans is the topic title listed as topic titles cannot include variables, there is no way of entering them. What you are doing is putting them in the topic heading which is not the same thing.

          So you can have variables in the topic heading and the topic will be found by the search including the variable. Your topic titles however need to be reconsidered.

          1 person found this helpful
          • 2. Variables do not work with topic titles
            Thanks for your reply Peter.

            Yes, it is indeed a limitation of RoboHelp and the way it uses HTML:

            * The topic title that appears in the topic's properties and in search results is stored in the HTML head <title> element.
            * The HTML 4.01 standard does not permit other elements inside <title> (see http://www.w3.org/TR/html401/struct/global.html#h-7.4.2).
            * Therefore, variables (which function via the <uservariable> tag) do not work in topic titles. Attempting to do so will result in all topic titles being cut off at the point where the <uservariable> tag ends, and will also (at least in my case) crash RoboHelp when you attempt to open the topic.

            A workaround:

            1. Create a backup of your help project.
            2. Use some find/replace tool or script to change the topic titles. In my case I used a series of Perl commands to do a find and replace. E.g.:
            perl -pi -e 's/\<title\>How to change a variable\<\/title\>/\<title\>How to change a tyre\<\/title\>/' How_to.htm

            I hope Adobe finds a way to fix this problem. It is a serious limitation.
            • 3. Re: Variables do not work with topic titles
              Peter Grainge Adobe Community Professional (Moderator)
              I don't think variable were intended to work in the Topic Title. As I indicated the variable do work in the Topic Heading, albeit with the issue I highlighted when you search. Don't forget, the topic title is not part of the topic.

              Nonetheless, I have alerted Adobe to this thread so perhaps in a future release. It helps if you add post a request at


              1 person found this helpful