• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Showing and hiding the TOC using JavaScript

Guest
May 29, 2009 May 29, 2009

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?

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 29, 2009 May 29, 2009

Copy link to clipboard

Copied

The user can hide it by clicking the X and show it again by clicking the Contents button.

Capture1.gif


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

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 30, 2009 May 30, 2009

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.

Capture2.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 30, 2009 May 30, 2009

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

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
May 30, 2009 May 30, 2009

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 01, 2009 Jun 01, 2009

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp