TOC not displaying in Chinese

This forum is for discussions on the Help & Manual Premium Pack and the Premium Pack Toolbox configuration utility introduced with Premium Pack 3

Moderators: Alexander Halser, Tim Green

Post Reply
Cono Fusco
Posts: 2
Joined: Mon Jun 06, 2016 1:32 pm

TOC not displaying in Chinese

Unread post by Cono Fusco »

Hi there,

I'm using a slightly customized version of the responsive webhelp skin from the PP to host our multi-lingual documentation on our website. One of the languages we have is Simplified Chinese.

The problem I have is that the table of contents is not visible in the left pane when I switch to Chinese. The content itself is visible and can be navigated using internal links, but the TOC simply does not appear. See here. Note that if you switch to another language using the Roman alphabet, the TOC is just fine.

My TOC contains a mix of Chinese and Roman characters. An example topic name would be: Therefore™ 帮助

I had a web developer colleague look into it briefly, and using the browser debugging tools he found these error messages:

SCRIPT5009: 'tocSource' is undefined
Function code (60) (2,1)


SCRIPT1015: Unterminated string constant
hmcontent.js (2,1030)


I figure tocSource might have something to do with it, but I'm not sure since I'm not a developer. Any idea what could possibly be causing this? I'm not sure if you can help since we did customize your base template, but any guidance you can provide is greatly appreciated.

Thanks.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: TOC not displaying in Chinese

Unread post by Tim Green »

Hi Cono,

There may be a problem with 'Chinese strings causing errors that needs to be fixed here. First please check whether the issue is caused by your modifications by publishing the project with an unedited copy of the skin. This should preferably be the current 3.15 version (your skin is based on 3.10), which you can get using the same download link you used for your present version.

If the problem persists, please mail me a small demo project at support AT ec-software.com (replace the AT with @), along with your modified skin, and I will check it for you. The simplest way to create a demo for mailing is to use the Save As option in the File menu to create a single-file .hmxz version (first option) and delete all but a handful of demo topics from the copy. We don't need the graphics files for testing, just the .hmxz and .hmskin files.
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.
Cono Fusco
Posts: 2
Joined: Mon Jun 06, 2016 1:32 pm

Re: TOC not displaying in Chinese

Unread post by Cono Fusco »

Hi Tim,

Many thanks for your response. Of course, I should have thought of publishing with an unmodified skin first :)

Indeed, the unmodified skin using PP 3.15 works fine. The TOC is visible and works as expected.

Looks like I'll have to get a developer involved to see what's wrong with our customization. Thanks for your help.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: TOC not displaying in Chinese

Unread post by Tim Green »

Hi Cono,

I looked at the source of your page and noticed that you have added some quite extensive JavaScript. When working with these skins it's important to understand that the pages are very dynamic, and adding script on the assumption that you can manipulate the DOM normally as in a normal static HTML page will not work.

In particular, there are two key things you need to know:

First, when the user is browsing topics, you are not reloading the page. Instead, the contents of a DIV on the page are dynamically replaced with the content of the topic you are browsing to. This is loaded from a compressed JSON version of the topic content, not from a normal HTML file.

Second, the TOC and the keyword index do not actually exist at all as normal HTML. If you look at the corresponding HTML files you will see that they do not contain any TOC or index entries. They are both generated on the fly as needed from JSON objects that only contain the basic data, no HTML at all. Also, you never have the entire TOC or index as HTML. Only the visible portions exist as HTML, and as soon as a branch becomes invisible again it is deleted from the DOM again. This makes it possible to large TOCs and indexes efficiently, particularly on mobile devices.

As an added note, the TOC, Index and Search pages are in iFrames, to reduce the overheads on the main topic page. Communication with and between the frames is performed using the postmessage protocol, which is much faster than any other method and makes it possible to run without a web browser without being blocked by same domain policy issues.
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.
Post Reply