How to force elements to be updated from file (V3 WebHelp)

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
markusflow
Posts: 50
Joined: Tue Apr 30, 2019 4:29 pm

How to force elements to be updated from file (V3 WebHelp)

Unread post by markusflow »

Hi all,

during testing of a V3 Responsive WebHelp Skins, I noticed the nice feature that when clicking a link, not alle HTML elements (like header) are reloaded. Only the topic content is loaded from the html file and the toc is synced.

We now have some non-default elements (e.g. a language switch per chapter in the header (<a href="de/<%HREF_CURRENT_PAGE%>">DE</a> | <a href="en/<%HREF_CURRENT_PAGE%>">EN</a>) which is not updated when following some links within the help.

Is there a way to define which elements should be newly loaded from html file when changing a chapter?

Example:

File a.html contains a language switch

Code: Select all

<a href="de/a.html">DE</a> | <a href="en/a.html">EN</a>
outside of the

Code: Select all

<div id="topicbody">
File b.html contains a language switch

Code: Select all

<a href="de/b.html">DE</a> | <a href="en/b.html">EN</a>
outside of the

Code: Select all

<div id="topicbody">
When opening a.html and call b.html via the table of contents, the links in the language switch still are

Code: Select all

<a href="de/a.html">DE</a> | <a href="en/a.html">EN</a>
Any hints are very welcome. Thanks

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

Re: How to force elements to be updated from file (V3 WebHel

Unread post by Tim Green »

Hi Markus,

As you have noticed, once you have opened a V3 skinned WebHelp you actually stay on the page you have opened. When you browse to new topics only the content of the topic is replaced, which is done from a compressed JSON copy of the topic content in the /jstopics folder, along with changing the URL via the history object, updating the keywords and title and so on. This is radically faster than reloading the entire page (15-100ms instead of a second or two), and along with a number of other tricks these skins use it makes performance on mobile devices much, much faster.

The downside of this is that you can't use any topic-based variables or components in the topic page template, because they are only loaded once when the user first opens the WebHelp. After that, only the content represented by the <%TOPIC_TEXT%> variable in the template is replaced during browsing. This means that the only way you can get things like that to update is to actually have them in the content of your topic.
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.
markusflow
Posts: 50
Joined: Tue Apr 30, 2019 4:29 pm

Re: How to force elements to be updated from file (V3 WebHel

Unread post by markusflow »

Thanks Tim for your detailed explanation.
markusflow
Posts: 50
Joined: Tue Apr 30, 2019 4:29 pm

Re: How to force elements to be updated from file (V3 WebHel

Unread post by markusflow »

For anyone with a similar issue, I did the following things to get things work:

1) I created a JavaScript based drop down menu which dynamically determines the file name of the currently displayed chapter and in correspondence to the user selection of the list opens this file/chapter in another language.

2) I wrote a JavaScript function for the PP V3 postloadfunc.js which allows me to dynamically update some elements outside the topic text.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: How to force elements to be updated from file (V3 WebHel

Unread post by Tim Green »

Hi Markus,

It's nice to see the postload function I included actually getting used. 8)
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