13 Replies Latest reply on Apr 27, 2006 7:39 AM by jhemmi

    Open New Instance of HTML Viewer Window

    jhemmi
      I've read several past posts about this subject, but I'm not clear how to accomplish my goal. Here's what I want to do:

      Click a text link and open a topic in a new instance of the HTML Viewer. This new topic is not in an external .chm file. I do want to be able to have this feature work on the network, as well.

      I think this question is loaded based on past posts. I'm a novice when it comes to coding directly, so baby steps would be good for me.

      Thank you!
      Jane
        • 1. Re: Open New Instance of HTML Viewer Window
          Level 2
          Jane,

          Using a "Shortcut control" and calling hh.exe would open a truly new instance of the HTML Viewer but what it sounds like you want is to open a "Secondary Window, " so that you have one instance but two topics open in two windows. Does that sound right?

          There is a catch to opening a second window due to a design flaw in the help viewer. You use a Related topics object (which allows you to set the window parameter), then build a redirect topic that automatically fires the related topic. This is covered in detail in the HelpWorkshop help file, but most people on this forum use the instructions in Rick Stone's Tips and Tricks file, which you can download from Rick's robowizard site.

          John
          • 2. Re: Open New Instance of HTML Viewer Window
            jhemmi Level 1
            John,

            I think that is the information that I need, but with my little experience, I can't get it to work. I've attached my code. I'm using RH X3.

            Thanks,
            Jane

            • 3. Re: Open New Instance of HTML Viewer Window
              Level 2
              Jane,

              I don't know why you have two Related Topics Objects. I like the CLASSID of the second one but it needs a
              <PARAM NAME="Window" VALUE="your second windowname">
              You also need to include a link to open this Object in the second window. That would be:
              <A HREF="Javascript:RelatedTopics.Click()">yourhyperlink texthere</A>
              Now when you click on the hyperlink text, it will fire the Related Topics, which will open your topic in a second window.

              Sure seems like a round about way of doing things doesn't it? The reason for this is that the Help API uses a > before the window name, but this confuses the HTML, which restricts the use of <>. The end result is that we have to use this extra step to define a window.

              John
              • 4. Re: Open New Instance of HTML Viewer Window
                jhemmi Level 1
                John,

                According to Rick's Tips N Tricks, you are supposed to have the following...

                <Param name'"window" value="your second windowname">

                ...in two places. When I test the link, and it doesn't work, the code in the CLASSID section is gone. What am I doing wrong? I did have the Javascript related links code, but I forgot to put it in the previous post.

                Thanks,
                Jane
                • 5. Re: Open New Instance of HTML Viewer Window
                  Level 2
                  Jane,

                  I use an old version of RoboHelp - from before the days of the KADOV tags - so your WYSIWYG editor might be stripping things out of the true code if you just type them in as I've written them. I have had trouble with RoboHelp when I try to paste in base code for several objetcs at a time. The RoboHelp WYSIWYG editor is notorious for "fixing" your code.

                  So, if code is disappearing, try to insert as much as possible from the WYSIWYG editor before tweaking the code. You will need to have two items - a Related Topics control and a link to the topic. The Related Topics control may not need any changing if RH lets you enter a Window name. If not, add <PARAM NAME="Window" VALUE="your windowname"> in the Related Topics object. The link should be modified to "javascript:RelatedTopics.Click()." That should be all you need to do.

                  Good luck,

                  John


                  • 6. Open New Instance of HTML Viewer Window
                    jhemmi Level 1
                    Hi John,

                    I decided to start over. I took the information you said, and I tried it again. I must be close because now I receive the following error message when I click my link to open the secondary window (The window name "InterfaceWindow" passed to HH_GET_WIN_TYPE has not been specified"). The secondary window name = InterfaceWindow. What do I do to define it correctly to be recognized? I defined InterfaceWindow on the Project Tab inside the Windows folder. I must be missing something.

                    Thanks!
                    Jane

                    P.S. Now the error message doesn't appear, but the window opens within the same instance of the browser. There's no place in the WYSIWIG to select InterfaceWindow.
                    • 7. Re: Open New Instance of HTML Viewer Window
                      Level 2
                      Jane,

                      I got a little confused when I reread your original post because you state you want this to work on the network, as well. So I need to backtrack a little. Are you currently working with a single .chm file for output? How many different window definitions do you have?

                      Once you open a window, any new content will replace the existing content. So, if I create a .chm file with a "main" window and a "second" window, the user could not have two topics open simultaneously in "second" windows or "main" windows but could have one topic in a main window and one in a second window. Your P.S. sounds like maybe you have just one window type.

                      Perhaps a secondary window is not really what you are looking for. Do you want a side window, for example step by step procedures, to open alongside your main help? This could also be done with a popup, although if each window has popup glossary terms for example, you'd want to use a secondary window. Or do you want to be able to open window upon window, as you see on some websites, so that the user can easily jump back two or three topics without closing any?

                      John
                      • 8. Re: Open New Instance of HTML Viewer Window
                        jhemmi Level 1
                        Hi John,

                        Whew, I thought you'd forgotten me!

                        I have multiple .chm files and have them merged. However, I don't need to open a topic from another .chm file, just within a single .chm. Does that affect things? Yes, I would like to make this "new feature" work on the network. Also, I originally had just one window - NewWindow - the typical window default. Now I created a second window - InterfaceWindow.

                        So I basically can have one topic open at a time. If I'm understanding correctly, I can have two topics open at the same time as long as they display in two different types of windows. In my case - NewWindow and InterfacWindow - which I defined in the Windows folder of the Project Tab.

                        Lot's of good ideas from you. Here's my original goal...My "procedure" topics have multiple tabs, so a user can easily navigate. I want to make my "Interface" topics have no tabs but open in a secondary window (the InterfaceWindow), so a user can reference it. It can be overridden by other Interface topics as users access them. Does that make sense?

                        Here's what I've discovered so far (and I'll post everything once we come to a conclusion): when you don't have the window defined within the CLASSID section, the topic appears in the main viewer, replacing the current topic. If you do have the window defined within the CLASSID section, you get the HH_GET_WIN_TYPE error. So, I think we're close, but the topic's not opening in the InterfaceWindow (secondary window).

                        Thanks,
                        Jane
                        • 9. Re: Open New Instance of HTML Viewer Window
                          Level 2
                          Jane,

                          OK. Now I'm clear I understand what you want to do and confident I'm not leading you down the wrong path. However, chm files will not open over a network and I am not well-versed in WebHelp, so I can't say if this will cause problems when you do try to move to the network.

                          The HH_GET_WIN_TYPE window not defined error usually occurs when you have spaces in your window name (you appear not to) or are accessing a topic from a different .chm that does not have the window defined. I'm stumped as to why you are getting that error and can only suggest double checking your window name spelling and that it is defined in the .chm where your desired topics reside.

                          John


                          • 10. Re: Open New Instance of HTML Viewer Window
                            jhemmi Level 1
                            John,

                            I saw a post about spaces in a window being a problem. No fix. I even used a single word just to be safe. No fix. Running on LAN or desktop still gives HH_GET_WIN_TYPE error. What's unusual is that the window definition in the CLASSID section keeps getting stripped out.

                            Clueless and frustrated,
                            Jane
                            • 11. Re: Open New Instance of HTML Viewer Window
                              Level 2
                              Jane,

                              I dusted off a trial version of X3 and yes indeed it strips out the window definition. Why? While this was not the intention for Related Topics objects, it was Microsoft's published workaround for the window bug. It will work if you compile before opening the topic in the WYSIWYG editor. You will also need to ensure that you add the .chm file name before the topic. You showed that in your original code and I think Rick stresses that in his Tips and Tricks file. If you leave it out, as per the RoboHelp added Related Topics, you do get the error you are seeing. Perhaps in redoing things, it got erased.

                              John
                              • 12. Open New Instance of HTML Viewer Window
                                jhemmi Level 1
                                John,

                                I did miss replacing the name of the .chm file, and that did produce a secondary window, but one that would not display the topic. Depending if the window name was the defined in the CLASSID section produced the HH_GET_WIN_TYPE error. LAN or local made no difference. We're so close!

                                Question...Is it ok to use a relative path after the .chm file name? Which is correct?

                                name.chm::/../path/path/topic.htm
                                name.chm::..path/path/topic.htm

                                Does it matter which direction the \ or / face?

                                Here's my code again, selected before clicking the WYSIWG tab; therefore, the window type is defined within the CLASSID.

                                Thanks so much!
                                Jane
                                • 13. Re: Open New Instance of HTML Viewer Window
                                  jhemmi Level 1
                                  As you can see, there was much trial and error. Here's the final process that will work for RoboHelp HTML X3. Thanks to Rick for the original explanation and to John McCallum for helping me through this process.

                                  Creating a Secondary Window in RoboHelp HTML X3

                                  NOTE: We are using a defined a secondary window on the Project tab called $global_InterfaceWindow. The $global_ prevents the error message HH_GET_WIN_TYPE error.

                                  1. Enter the name of the text to which you want to create a secondary window. In this case, we will use ABC window.

                                  2. Select ABC window and click the Insert Hyperlink button.

                                  3. Enter JavaScript:RelatedTopics.Click() in the Link to field and click OK.

                                  4. Click next to the hypertext, and select Related Topics… from the Insert menu. The Related Topic Wizard dialog box opens.

                                  5. Click Hidden (for scripts) option button, and click Next.

                                  6. Select the topic to which you want to link, and click Add.

                                  7. Click Next. Click Next again. Click Finish.

                                  8. Click the Hidden rectangle , and click the TrueCode tab.

                                  9. Locate the following phrase in green text.

                                  <param name="Items" value="ABC Window\STYLE003.htm$$**$$" >

                                  Insert Name.chm::\ after ABC window;

                                  <param name="Items" value="ABC Window;Name.chm::\STYLE003.htm$$**$$" >

                                  NOTE: The path to your topic is not always the same path used in Windows Explorer. Be sure to set the path correctly, or the topic will not display.

                                  10. Complete the same process in the gray area; that is, the CLASSID section of the code.

                                  11. Locate the following phrase in green text.

                                  <param name="Window" value="" >

                                  Enter $global_InterfaceWindow between the double quotation marks.

                                  <param name="Window" value="$global_InterfaceWindow" >

                                  12. Copy this phrase and paste it in the gray area; that is the CLASSID section of the code.

                                  NOTE: Once you paste this phrase in the CLASSID section, you cannot click the WYSIWYG tab because it will remove the copied phrase. Click a different topic to save it in the TrueCode tab. If you need to access the TrueCode tab again for this topic, you MUST copy and past this phrase back inside the CLASSID section.