Merged WebHelp - TOC Links

What's covered?

The normal way of producing the TOC in merged webhelp is to create a TOC in each project covering the topics in that project. In the parent project, you add a reference to the sub project wherever you want it to appear in the combined TOC. Sometimes in a merged webhelp setup, a book in the parent project, or one of the others, needs a reference to a topic in another project and this topic describes how that can be done.

The method is quite straightforward once you have got your mind around it and it's not as fiddly as it looks.

Method

First, create the new TOC page under whatever book you want. In this example, I will be using the same projects as in Merging WebHelp (the original method) and creating a link from the TOC in the main project to a topic in Project B. In the main project, create or go to the required book and then click on the Create New Page icon to display the TOC Page Properties.

To target the topic in the other project, you need to enter something in the Link To field.

Work out the relative path to the target topic as it will be in the published output (and I emphasise "in the published output", not the source). So creating a link from the main project to Topic 1 in project B in the projects shown in the example...

 

...the link would be

FROM

\Test Publish

TO

\Test Publish\mergedprojects\module_B\Module_B_Topic_1.htm

which would give a relative path of

.\mergedprojects\module b\module_b_topic_1.htm

Now for the fun bit, if you enter that correctly in the Link To field of the properties for the TOC page, RH will remove the .\ at the beginning. Save the TOC and go back to the properties and you will see RH has changed the path. If you were to publish now and this link was the only one in the book, you would not even see the book in the TOC.

Now re-enter the path as

..\mergedprojects\module b\module_b_topic_1.htm

Note the extra stop and I know it's wrong, just bear with me.

Publish the projects again and now you will see the Book in your TOC. You will also see the link but it will not work at this stage. You will get "Page cannot be displayed"

Now you need to locate the whxdata folder in your published output and open the file whtdata0.xml in Notepad or any text editor. You will see lines something like

<book name="Another Project" >

  <item name="test" url="..\mergedprojects\module b\module_b_topic_1.htm" />

Remove the extra full stop (period) at the beginning of the url so that it reads

url=".\mergedprojects\module b\module_b_topic_1.htm"

and open the published help.

Hey presto, it works.

I haven't tested in a full scale project to see if there are any issues but I cannot see any except as below. Any links in the target topic itself will not have been changed so they should be OK. Also any other links to the target topic will not be affected so they too should be OK.

Care when republishing

Each time you publish your webhelp, if you make a change to either the TOC or you select the Republish All checkbox, then RH will rewrite whtdata0.xml. Your previous amendments will be lost and have to be redone. If you haven't changed your TOC, then either clear the Republish All checkbox or save a copy of whtdata0.xml somewhere safe and replace the new version after publishing.

 

Date

Changes to this page

10 Jan 2004

New topic