5 Replies Latest reply on Jul 6, 2016 8:08 AM by Captiv8r

    How to make Webhelp open books auto-close when changing focus

    Roy_Jose

      Hello,

      I have created a Webhelp output. It has numerous books, and when I open books one by one, the TOC tree remains expanded and looks too crowded. It would look much better if the open book closed automatically when I open another book.

       

      I was exploring the files in output folder, and I came across this file -whnvt30.html - in folder WebHelp\whgdata\. Opening this file loads the TOC in a browser. On clicking the books in TOC, they expand and collapse exactly the way I want it to be in output. This behavior is somehow controlled in output.

       

      Can anybody throw some light on this?

       

       

      Roy

        • 1. Re: How to make Webhelp open books auto-close when changing focus
          Willam van Weelden Adobe Community Professional & MVP

          Hi and welcome to our community.

           

          The files in whgdata are HTML only files and are used for very old browsers or pure HTML output. Try opening whnjs.htm as that may do what you want. There is a catch however: If you want some styling, you need to amend whnvt30.htm an each whlsttx.htm (where x is a number) to apply the correct styling. Also, with context sensitivity you can only call topic through the relative path, such as whnjs.htm#New_Topic1.htm, otherwise the help defaults to the regular TOC. Oh, you need to amend the other .htm files as well if you want to style the glossary, index and search too. But a simple search and replace to add a CSS might suffice. And there's another catch: Do you want a true search function? HTML only only provides a list of search terms a user needs to scroll through.

           

          The HTML only TOC is just a bunch of files linked to each other. If you click a book, you open another file with only that book expanded.

           

          WebHelp holds three methods for showing the TOC: based on XML files in whxdata, HTML only in whgdata and JavaScript based in whdata. Every browser I've tried defaults to the XML based TOC in whxdata. If you want to use the default method, you will have to amend whthost.js. Believe me as I say that you don't want to go that way unless you have no other choice (including leaving it as it works now).

           

          Greet,

           

          Willam

          • 2. Re: How to make Webhelp open books auto-close when changing focus
            sarar4769315

            Hi,

            Did you ever get this to work?

            Thanks, Sara

            • 3. Re: How to make Webhelp open books auto-close when changing focus
              Captiv8r Adobe Community Professional & MVP

              Interesting, I just responded to a private email message from a former class participant. And here's what I replied with.

               

              Unfortunately there has never been a way to easily coax that behavior. Not that I've ever seen. I know it's a behavior that can be achieved using CHM files, but likely only because I believe CHM files use a special control to present the TOC. In WebHelp, things operate a bit differently.

               

              However, in thinking about this, there may be a way to make this happen. But how it would work might be a bit laborious.

              Just how far down the rabbit hole are you willing to go?

              When you open a topic directly, depending on the settings used in the SSL recipe, special JavaScript code is added to the topic that causes a "show" link to be written into the top part of the topic. And when the end user clicks that link, the topic reloads with the surrounding frameset. And typically, the TOC would be expanded and synchronized to the open topic with all other books collapsed.

               

              That's the behavior you are seeking, right?

               

              Sooo I'm thinking that if one were diligent, they could create a TOC where instead of linking to just the topic, they linked instead to the URL that caused the behavior above. It would require a few hoops to be jumped through.

               

              1. You would need to generate output and ensure the option for "Show Navigation Pane Link in Topics" is enabled.
              tmp3.png

               

              2. You would then need to copy the output to the server or web server where it will ultimately be.

               

              3. Then carefully open each topic by just opening the HTM page so you can see the "Show" link. (Note: Once you get the gist of how the links are constructed, you could omit clicking EACH and EVERY topic to obtain that URL and you could just fabricate it based on the pathing you noted.)

              4. You would then note and copy the URL in the address bar. (That's the URL you will need to launch just the topic)

               

              5. You then would return to the project source and modify the TOC by carefully editing each entry so instead of pointing to the topic, it now points to the URL that opens the topic on its own and synchronized to the TOC Book.
              tmp1.png

               

              6. While looking at this dialog, you would click the Advanced tab for each entry and configure the TOC Entry to open in "Whole Page".

              tmp2.png

              7. Dismiss the dialog, generate the WebHelp and replace what is on the site with the new version and you should be set.

               

              The bottom line with this approach is that each link to a topic that the user clicks completely reloads the WebHelp with all books collapsed except the book the topic is inside.

               

              Cheers... Rick

              • 4. Re: How to make Webhelp open books auto-close when changing focus
                Captiv8r Adobe Community Professional & MVP

                I thought it might be worth mentioning that this approach would only apply to links being clicked inside the TOC. If you have a link in a topic that links to another topic inside a different book, you would not see the existing book close and the destination book open. Unless, of course, you coded the link from the topic to match the link in the TOC.

                 

                Cheers... Rick

                • 5. Re: How to make Webhelp open books auto-close when changing focus
                  Captiv8r Adobe Community Professional & MVP

                  Well darnitol!

                   

                  In THEORY this should work. In actual practice, there seems to be a few wrinkles.

                   

                  I put together a project to play with this suggestion and I posted it to my web host. To see it, visit the link below:

                   

                  http://www.robowizard.com/CloseTest

                   

                  Basically, I configured the bottom two books to try and behave as I stated.

                   

                  One of the issues I discovered was that I had to first disable the Breadcrumbs. With Breadcrumbs enabled the external links refuse to work.

                   

                  Another issue is that even though the links now work to "collapse" everything (by reloading the WebHelp) the TOC doesn't synchronize to the open topic. And in pondering that, I realized my error. There is really nothing to sync to, because the link is simply pointing at a URL. So even though it would appear this should be the topic, because it's just a URL to the TOC, the code has no clue that it should expand that book.

                   

                  Cheers... Rick