15 Replies Latest reply on Oct 6, 2008 7:57 AM by Sean Samuel

    hyperlink to topic in second window

    Sean Samuel
      Hello everyone

      I am trying to create a hyperlink from a topic displayed in the Main window of a .chm to a topic that is displayed in a Second window of the .chm.

      In the past I have created a link from a button to display a topic in a window named About using a Related Topic.htm technique. I have tried using this technique using the same Related Topic.htm but it does not seem to work.

      There may be a more simple way to do this but I don't know ?

      All help gratefully received.
        • 1. Re: hyperlink to topic in second window
          RoboColum(n) Level 5
          I think you'll have to explain this a bit more as I haven't even had my first cup of coffee today! Are you referring to a single CHM open in two windows? It sounds like you are. And what exactly is "a Related Topic.htm technique"? Is this some sort of redirect topic?
          • 2. Re: hyperlink to topic in second window
            Sean Samuel Level 1
            Hello Colum

            Sorry if the question was a bit vague. Like you it is still quite early, but luckily for me I have actually had a cup of coffee.

            Anyway you are right on both counts, I am trying to show a topic in a second window of the same chm. The Related Topic technique I refered to is something I have pick out frorm Rick Tips and Tricks in the past, and use on all my help file.

            Thanks for you interest
            • 3. Re: hyperlink to topic in second window
              RoboColum(n) Level 5
              OK I've had a coffee now and I'm guessing the linked topic isn't in the TOC so you can't change the properties of the TOC entry to display in the About window? It sounds like you had it working but no more. Have you checked and double checked the path in the redirect topic? Has the topic been moved/renamed? If all this is OK, can you tell us what happens when you click on the link.
              • 4. Re: hyperlink to topic in second window
                Sean Samuel Level 1
                In fact it is a bit more simple than that, just like me.
                All I want to do is create a hyperlink that wil show a topic from the same chm in a second window.

                Does that make sense... ?
                • 5. hyperlink to topic in second window
                  Captiv8r Adobe Community Professional & MVP
                  Hi there seaandsamuel and Colum

                  Admittedly, I haven't tried the technique of using a Related Topics control in RoboHelp 7. Not sure if I tried it in 6 either. So it's possible that something got broken where it used to work. Could be the RoboHelp side and it could be the Microsoft side, what with all the recent patches and whatnot.

                  Colum, what is being referred to here is using a Related Topics control to link to a different topic inside the same .CHM file and have that topic open up in a secondary window you have defined for the .CHM.

                  It's really a shame that we have to jump through hoops to do this. I remember voicing a concern over it and bringing it up in beta after beta back in the eHelp days. But it was always met with silence. I guess the development team back then either considered it was too difficult to code in or not enough folks would actually want it so as to warrant the change. But I digress...

                  seandsamuel, if I get a moment during my RoboHelp class today (and if I remember ) I'll try to test it in 7. I do recall that X5 was really fussy with it and I had to struggle to finally coax it to work.

                  Cheers all... Rick
                  • 6. Re: hyperlink to topic in second window
                    Pete Lees Level 2
                    Hi, all,

                    If it's any help, here is the code of a Related Topics control that opens the target topic in the nominated window.

                    <object classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
                    <param name="Command" value="Related Topics">
                    <param name="Button" value="Text:Text to display on button">
                    <param name="Window" value="About">
                    <param name="Item1" value="Topic Title;YourHelpFile.chm::/TargetTopic.htm">
                    </object>

                    Even though the source and target topics are in the same .chm file, it's necessary to prepend the .chm file name to that of the target topic ("YourHelpFile.chm::/TargetTopic.htm").

                    The code above works fine in my test .chm file, but admittedly I didn't use RoboHelp to create it.

                    Pete
                    • 7. Re: hyperlink to topic in second window
                      Sean Samuel Level 1
                      Thanks Pete
                      Are you suggesting not to use a hyperlink but use the Related Topics command from the Navigation Control Menu. Then edit the code to mimic what you shown ?
                      • 8. Re: hyperlink to topic in second window
                        Pete Lees Level 2
                        Hi, Sean,

                        Yes, that's right.

                        Pete
                        • 9. Re: hyperlink to topic in second window
                          Sean Samuel Level 1
                          OK, that works Pete, thanks

                          But why does the text not appear the same as the rest of the text on the line ?

                          It also has a box around it that does not appear in the final chm file. I am guessing this is the Related Topic control area.

                          And this causes another problem in that when you change from HTML view to Design view you lose the second window configuration.
                          • 10. Re: hyperlink to topic in second window
                            Pete Lees Level 2
                            Hi,

                            You can add a Font parameter to the control, like this:

                            <object classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
                            <param name="Command" value="Related Topics">
                            <param name="Button" value="Text:Text to display on button">
                            <param name="Font" value="Verdana,12,,,PLAIN">
                            <param name="Window" value="About">
                            <param name="Item1" value="Topic Title;YourHelpFile.chm::/TargetTopic.htm">
                            </object>

                            See this page for more information on the Font parameter:

                            http://msdn.microsoft.com/en-us/library/ms644677(VS.85).aspx

                            Alternatively, you can insert a hidden instance of the control and then use scripting to invoke it, like this:

                            <p>Click <a href="JavaScript:hhctrl1.Click()">here</a> for more information.</p>

                            <object id="hhctrl1" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
                            <param name="Command" value="Related Topics">
                            <param name="Window" value="About">
                            <param name="Item1" value="Topic Title;YourHelpFile.chm::/TargetTopic.htm">
                            </object>


                            Pete
                            • 11. Re: hyperlink to topic in second window
                              Sean Samuel Level 1
                              Hello Pete
                              I can now get the topics to appear in a sceond window, but when I change to HTML View the additional code required for this to work is removed.

                              Is there a way of stopping the code from being removed when switching between HTML view and Design view ?

                              I have used the attach code button to shown what the code is.

                              I have also noticed that the Related Topics link does not appear the same as if it were a hyperlink, i.e. just part of the text. It is slightly raised higher that the baseline of the text on the same line.

                              Can you help with this ?
                              • 12. Re: hyperlink to topic in second window
                                Captiv8r Adobe Community Professional & MVP
                                Hi there seandsamuel

                                You might try the following. Might work and might not. Immediately after modifying the HTML, click the save button and close the topic. See if that makes the edit stick. It may and it may not, so you will be a bit of a guinea pig for this.

                                As for having the link look like a normal hyperlink, here is how you may do it. Configure the control to be "Hidden, for scripts". Hover it in the editor and note the name that appears in brackets in the tooltip when you hover. It could be:
                                * [RelatedTopics]
                                * [object1]
                                * [OBJECT1]

                                After you note the name, you simply move the control elsewhere on the page and type the text you wish to see as a standard hyperlink. Then select the text and elect to make it a hyperlink. But instead of linking, you type this into the field:

                                JavaScript:RelatedTopics.Click();

                                Note that you would substitute whatever you noted in the brackets where RelatedTopics is (if it's different).

                                Hopefully this helped... Rick
                                • 13. Re: hyperlink to topic in second window
                                  Sean Samuel Level 1
                                  That's it. Thanks Rick.

                                  The only problem now is ensuring the defined window does not change when switching between HTML and Design view.

                                  I do seem to remember that in one of your tips you suggested changing the classid code, e.g. CLASSID="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11".

                                  Is that right ?
                                  • 14. Re: hyperlink to topic in second window
                                    RoboWizard Level 4
                                    Hi again

                                    I'd say to avoid that. It was a workaround offered for a very old version of RoboHelp HTML. IIRC, Jason Eberwein of eHelp offered that. It caused RoboHelp to gag a bit but it worked (at the time). I seem to recall that latter versions of RoboHelp didn't like it at all. Try it if you like, after all it's an easy fix if indeed something changed and the Adobe guys have made it work. But be very wary of what happens after. Not that it will like kill your project or anything. At worst, it simply won't work or may cause RoboHelp to crash. But usually that's an easy recovery. Particularly if you know exactly which topic caused the issue.

                                    Cheers... Rick
                                    • 15. Re: hyperlink to topic in second window
                                      Sean Samuel Level 1
                                      Ok Rick, I might give it a try but I won't hold my breadth.

                                      As for making topics appear in a defined second window, you instructions were spot on, thank you very much. I actually had 3 links to topics that I wanted to appear in a second window. so by leaving the first link as

                                      JavaScript:RelatedTopics.Click();

                                      then changing the second and third to

                                      JavaScript:OBJECT1.Click(); and JavaScript:OBJECT2.Click();

                                      and defining the Second window it all worked as I wanted.

                                      Once again many thanks, you guys truly are RoboHelp gurus