Secondary Windows in HTML Help

You can launch an HTML Help topic into an independent secondary window by creating a Related Topics control, then add a few parameters in TrueCode. This technique is described in the HTML Help Workshop Help file (htmlhelp.chm), but it is not clear how to get it to work in RoboHelp since additional parameters are added by RoboHelp.

Create a new Help Window

First create a Help window that your topic will launch into.

  1. Open an HTML Help project.

  2. Click the Project tab.

  3. Right click the Windows folder and choose New Window.

  4. Name the window Second.
    This window name is used in the Related Topics control created later

  5. Turn off TOC & Index.

    This creates a clean window without any additional options.

  6. To make the window float on top click Advanced Properties.

  7. Click Extended Styles tab and select Top Most Window.

  8. Click OK twice.

Create a Related Topics control

This exercise requires two topics: a source topic and a destination topic. You first insert a Related Topics control on the source topic and then create a hyperlink that opens the destination topic into a secondary window when the link is "clicked."

  1. Open a source topic.

  2. Choose Insert: HTML Help: Related Topics.

  3. Choose Hidden (for scripts) and click Next.

  4. Select the topic you wish to open into a secondary window and click Add.

  5. Click Next, Next, and Finish.

    The Related Topics control appears as in the image above.
     

  6. Select the hidden control and click TrueCode.
    You must add four variables to the code.  

    Note: A hidden control is not required to make this exercise work.  This exercise demonstrates two features: hidden controls and activating a Related Topics control from a hyperlink. You could also create a button or an image to activate the window.

  7. In TrueCode, locate the parameter line in the green text that reads:
    <param name=Items value="Sec Window1;Sec_Window1.htm$$**$$" >


    where Sec Window1;Sec_Window.htm is the title and file name of a topic you want to open into a secondary window

  8. Change the line to:
    <param name=Items value="Sec Window1;
    YourHelp.chm::/YourFolder/Sec_Window1.htm$$**$$" >

    where YourHelp.chm::/YourFolder/Sec_Window1.htm is your CHM file, subfolder, and html file you want to open into a secondary window.

  9. Highlight and copy the help file and folder names just created (YourHelp.chm::/YourFolder/)and paste it inside the gray parameter tag lines (see image below).
    The file name information must be added in both places so RoboHelp knows it is there.

  10. Locate the line:
    <param name=Window value="" >


    Change the line to:
    <param name=Window value="
    YourWindow" >

    Where YourWindow is the name of secondary window created in the first part of this exercise.

  11. Highlight the entire parameter and copy it.

  12. Paste the code as a new line into the gray object tag line.

  13. When finished you should have added made changes to four lines.

     

Create a Hyperlink that opens a Secondary window

This is an optional step if you choose to insert the Related Topics control as a button or image (rather than hidden).  Since the previous exercise places the button as hidden, you have to add a link to the page to activate it.

  1. On the topic you wish to launch a secondary window from, type:
    Open Secondary Window
    .

  2. Highlight the text and click Insert Hyperlink.

  3. In the Link to field type:
    JavaScript:RelatedTopics.Click()


    Do not
    select a topic.

  4. Click OK and Compile and Run the project.

  5. Click the link.

     

NOTE:
I've discovered a bug with the final parameter:
<param name=Window value="Second" >

Somehow the code disappears from TrueCode if any additional modifications to the HTML Help Control are made in WYSIWYG mode.  So you should make and save your changes, but do not modify the control in WYSIWYG mode or the Window value parameter may disappear.

 

That's it for this month's tip!!

Back to the beginning of the tip

Kind Regards,

Rob Magrino
Certified XxxxXxxx Instructor
Certified Technical Trainer
Microsoft Certified Professional