Copy link to clipboard
Copied
Hello,
Is there a way to show or hide the WebHelp Table of Contents (TOC) at run-time using JavaScript? Also, can the TOC be hidden by default when viewing WebHelp content?
Copy link to clipboard
Copied
The user can hide it by clicking the X and show it again by clicking the Contents button.

Is that not what you want?
You can open any topic without the navigation pane by opening it direct rather than using the start page. Double click any topic in Windows Explorer and you will see what I mean. Unless you have turned off the option, there will be a Show link at the top of the page and that will then display the navigation pane.
See www.grainge.org for RoboHelp and Authoring tips
Copy link to clipboard
Copied
Thanks, Peter.
Although the UI buttons are capable of showing or hiding the TOC, I was wondering whether this could be done programmatically with JavaScript. I believe I found the answer to my own question. In the whtopic.js file, there's a function named showHidePane(bShow) that hides the TOC if bShow is false and shows it if bShow is true.
I need such a function to automatically hide the TOC when WebHelp is launched, while preserving the menu bar. When a topic is launched directly, the menu bar is not shown, unfortunately. I wish there was a checkbox in the WebHelp Navigation screen that said something like Show Navigation Pane on Startup.

Copy link to clipboard
Copied
I believe that can be done through the CSH API but that's developer territory.
The API is described in the help plus there are some links on my site.
See www.grainge.org for RoboHelp and Authoring tips
Copy link to clipboard
Copied
Hi there
I've documented a way to make this happen in my Skinny on Skins file.I think it still works with current WebHelp.
Perhaps that will help?
Click here to visit the download page
Cheers... Rick ![]()
|
Copy link to clipboard
Copied
Thank you, Peter and Rick.
The Skinny on Skins topics named Hide Navigation Pane when WebHelp loads - Method 1/2 are very helpful, but they don't quite offer a complete solution. This is because the navigation pane always gets hidden whenever the modified topic is viewed, even after a user decides to show the pane, resize it, or return to the topic (i.e., it is stateless). However, they were instrumental in helping me find a solution, which is described below.
The trick to hiding the Navigation Pane (TOC) only when WebHelp is initially launched is to declare a global variable to keep track of it. The default topic (i.e. the first topic that is seen) should contain the following script in the <body> (or <head>) tag.
<script>
var topWin = window.top;
if (topWin.isTOCHidden == undefined) {
setTimeout('showHidePane(false)',100);
topWin.isTOCHidden = true;
}
</script>
You can also include this code in a master page to ensure all topics are capable of hiding the TOC on startup.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now