WebHelp Toolbar Buttons that Show and Hide the Navigation Pane

WebHelp Toolbar Buttons that Show and Hide the Navigation Pane

In WebHelp, the buttons for the TOC, index, search and glossary will only make the navigation pane visible: When the TOC is already opened, clicking the TOC button again will not hide the TOC. With the attached script you can create buttons that will show and hide the navigation pane based on the opened pane. For example: You click the TOC button to open the TOC. Click the TOC button again and the navigation pane will be hidden.

A special thanks goes to Abbey Schulz who helped setting the requirements and helped testing.

Download JavaScript file Download JavaScript file.

Follow these steps to set up your buttons:

  1. Download the attached file and extract the JavaScript file..
  2. Add the JavaScript file as a baggage file to your project.
  3. Open the skin editor.
  4. Create a new button, call it ShowHide TOC. You can set any text or image as you see fit.
  5. On the action tab of the new button, add the following code in the OnClick field: setpane('toc');
  6. Now choose External JavaScript fileand choose the JavaScript file you just added as a baggage file.
  7. Now style the button any way you want.
  8. Now you have to create buttons for the index, search and glossary. You do this by creating buttons and setting the correct OnClick event. Do NOT reference the external JavaScript file, as that is already referenced for the TOC.When you create an output without a TOC button at all, reference the JavaScript file for another button.
    • Index: setpane('idx');
    • Search: setpane('fts');
    • Glossary: setpane('glo');
  9. Save the skin.
  10. Go to the SSL properties and select your four (or less) custom buttons AND the default buttons. If you want to have a TOC, select both the custom TOC button and the default TOC button.
  11. Save you SSL settings.
  12. Generate the layout.
  13. Go to your output and open whskin_tbars.htm in Notepad or another text editor.
  14. Search for addButton( in the bottom of the file. The default buttons are the function calls with the first variables set to toc, idx, fts and glo.
  15. Comment out the default buttons that you want replace by your custom buttons. You comment those buttons out by adding //in front of the function call.
  16. Save your changes.

The code in the file will look something like:



Abbey's picture

Hi William,
Sorry to say that since I upgraded to Robohelp 10 this javascript is giving me errors due to the following section:

if(cust_navpanevisible() && (window.currentpane == pane)) {
var oMsg=null;
oMsg=new whMessage(WH_MSG_HIDEPANE,this,1,null);
I can successfully show the navigation pane, but when I click again to hide I get the following error in FireFox developer tools:
ReferenceError: SendMessage is not defined.
How can I fix it?

Willam van Weelden's picture

I've updated the script to also support RoboHelp 10. Please redownload the script and replace your current script with the new one.

sharada's picture

Hi William,
I am using Robohelp 10 and followed the steps as given in this website. But it simply did not work, on clicking show/hide toc, there was no action performed.
Am I missing anything, request your help.

Willam van Weelden's picture

This optimization is very fragile, so there can be quite a few things going wrong. Can you zip up your output and share it with me? I would like to take a look to see what is causing this issue.

Add new comment

Latest Tweets

Shopping Cart

View your shopping cart.

Recent Content

Copyright WvanWeelden Consultancy. - Terms and conditions - Privacy policy - Taxes apply to all prices. Subscribe to WvanWeelden.eu Blog Back to Top

Back to Top