How to force the TOC to expand at a specific topic?

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
olgarev_tw
Posts: 54
Joined: Tue Oct 28, 2014 8:07 am

How to force the TOC to expand at a specific topic?

Unread post by olgarev_tw »

Hi!
Our H&M projects usually have more than 10 chapters on the upper level and up to 5-7 levels in each chapter in TOCs. When a user asks us a question "Where can I read about..." we use to give him the direct link to the specific topic, such as "...index.html?case123.htm". But when the user opens such link he sees the TOC collapsed in the left frame. Is there any way to expand the TOC on this specific topic too? This will help the user to understand the context better.

Thanks in advance!
Frank_Wibu
Posts: 32
Joined: Tue Sep 13, 2011 10:10 am

Re: How to force the TOC to expand at a specific topic?

Unread post by Frank_Wibu »

Hi,
if you use WebHelp output format I guess in the HTML Export Options section of Configuration you are able to set the option "On load expand" see http://www.helpandmanual.com/help/hm_pr ... gation.htm.
Ttfn, Frank
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: How to force the TOC to expand at a specific topic?

Unread post by Tim Green »

Hi Olgarev,
olgarev_tw wrote:Hi!
we use to give him the direct link to the specific topic, such as "...index.html?case123.htm". But when the user opens such link he sees the TOC collapsed in the left frame.
If the TOC is not opening to the displayed topic and highlighting it this means that your template or skin is not working correctly. This has nothing to do with getting parts of the TOC to open automatically when the help is opened. The current topic should ALWAYS be highlighted and displayed in the TOC when the topic is displayed. If it is not something is broken -- for example, you may have accidentally damaged your template or skin by editing it incorrectly.

Try re-publishing your project with one of the new standard skins included with Help & Manual 7 without editing the skin at all. You should find that when you link to a topic the TOC will be opened at the topic and it will be highlighted. Note that you MUST use the correct syntax:

index.html?topic_id.htm#anchor_id

where "index.html" is your index file, "topic_id.htm" is the ID of the target topic in all lower case letters (special characters in topic IDs are replaced by underscores, it's best not to use them at all in topic IDs) and "anchor_id" is an optional anchor, also in all lower case letters. (Anchors should also be defined in all lower case.)

Linking directly to a topic file without the index.html? prefix used to automatically reload the entire UI with the TOC. However, Google no longer indexes pages that reload themselves like this so we have removed this default setting in HM 6.4. Now linking directly to a topic page only will open the topic file on its own. The current skins provided with HM and the Premium Pack skins automatically display a "Show Table of Contents" link above the title of the topic when this is done so that the user can manually show the entire UI.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
olgarev_tw
Posts: 54
Joined: Tue Oct 28, 2014 8:07 am

Re: How to force the TOC to expand at a specific topic?

Unread post by olgarev_tw »

Frank_Wibu wrote:Hi,
if you use WebHelp output format I guess in the HTML Export Options section of Configuration you are able to set the option "On load expand" see http://www.helpandmanual.com/help/hm_pr ... gation.htm.
Ttfn, Frank
This option can "expand either all entries or just top-level entries (main chapters)", that's not exactly what we need.
olgarev_tw
Posts: 54
Joined: Tue Oct 28, 2014 8:07 am

Re: How to force the TOC to expand at a specific topic?

Unread post by olgarev_tw »

Tim Green wrote: If the TOC is not opening to the displayed topic and highlighting it this means that your template or skin is not working correctly. This has nothing to do with getting parts of the TOC to open automatically when the help is opened. The current topic should ALWAYS be highlighted and displayed in the TOC when the topic is displayed. If it is not something is broken -- for example, you may have accidentally damaged your template or skin by editing it incorrectly.
Thank you very much for your advice! I republished the project with one of the standard skins and it works! But I really need to fix my skin :) Please can you point which part of the skin code is responsible for such behavior?
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: How to force the TOC to expand at a specific topic?

Unread post by Tim Green »

Hi Olgarev,
Please can you point which part of the skin code is responsible for such behavior?
It's impossible to say from here -- I can't see your skin... 8)

The best way to find problems like this is to start fresh and make your changes slowly. Start with a fresh copy of the standard skin you based your skin on. Then make your changes one step at a time and do a test publish with a small project after every change. You will then quickly discover where the mistake is.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
olgarev_tw
Posts: 54
Joined: Tue Oct 28, 2014 8:07 am

Re: How to force the TOC to expand at a specific topic?

Unread post by olgarev_tw »

I've made it! )) The problem has gone when I removed the style links in Configuration -> Publishing Options -> Web Help -> Table of Contents.

This way is OK:

<!-- This line includes the general project style sheet (not required) -->
<link type="text/css" href="<%STYLESHEET%>" rel="stylesheet">

This way is NOT OK (even when style.css is an absolutely empty file, specially created and added to the baggage):

<!-- This line includes the general project style sheet (not required) -->
<link type="text/css" href="<%STYLESHEET%>" rel="stylesheet">
<link type="text/css" href="style.css" rel="stylesheet">

"Curiouser and curiouser!" (C) ))
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: How to force the TOC to expand at a specific topic?

Unread post by Tim Green »

"Curiouser and curiouser!" (C) ))
The name of your own CSS file probably has exactly the same name as the CSS file generated by the <%STYLESHEET%> variable. This then overwrites the original file, and all the necessary CSS information is lost. The baggage files are always written last to make it possible for you to overwrite Help & Manual's standard output files if you need to. However, in this case it is counterproductive.

If you want to add your own CSS file you need to make sure that its name does not conflict with any file names used by Help & Manual. The name of the CSS file generated by the <%STYLESHEET%> variable is set in Configuration > Publishing Options > WebHelp > HTML Export Options. For CHM the file name is set in Configuration > Publishing Options > HTML Help > HTML Export Options
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
olgarev_tw
Posts: 54
Joined: Tue Oct 28, 2014 8:07 am

Re: How to force the TOC to expand at a specific topic?

Unread post by olgarev_tw »

Thank you for the explanation. No, the value of the <%STYLESHEET%> variable is "default.css", so there is no name conflict, I guess. But the problem is solved, though.

Thanks very much for response!
Post Reply