Show value of TOPICLASTEDITED in footer

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
Baum&Help
Posts: 18
Joined: Fri Nov 23, 2007 1:16 pm

Show value of TOPICLASTEDITED in footer

Unread post by Baum&Help »

Hi,

When designing a new skin based on Minimalist_Standard_webhelp 3.45 I ran into a difficulty showing the value of <%TOPICLASTEDITED%> in the footer.

When a topic is loaded, only the HTML META <TITLE> and HTML META <DESCRIPTION> are changed.
It would be great if a (new) HTML META key "revisiondate", or something like that, could be added to list of META tags that is synced with the loaded topic.
Or is there another way to get the value of this topic property?
I developed a workaround with embedding html code in every topic text, and using a postload js function in the skin. But this is not what I want.

Thanks for your help.
André
André van den Boogert
Realworld Systems
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Show value of TOPICLASTEDITED in footer

Unread post by Tim Green »

Hi André,

Unfortunately, it's not possible to use topic variables outside of the topic content in these skins, because of the way that browsing is done. The footer must be part of the main page loaded when the visitor first access the WebHelp. That is unavoidable, because it must be in the HTML page template. Once that page is loaded, the page itself isn't changed any more while the user is browsing. New topics are loaded by replacing just the topic content with the content of the new topic from a compressed JSON version of the topic content only. This is what makes the browsing so fast, because nothing else needs to be reloaded -- all the other main WebHelp page contents, including all the scripts and CSS files, remain in place and don't need to be reloaded.

The downside of this is that you don't get the topic variables, because Help+Manual doesn't include those in the compressed JSON topic content. The only other way to get them would be to read the entire HTML topic file as well as the compressed JSON file every time a new topic is loaded, and that would defeat the entire purpose of the fast browsing construction. :?
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.
Baum&Help
Posts: 18
Joined: Fri Nov 23, 2007 1:16 pm

Re: Show value of TOPICLASTEDITED in footer

Unread post by Baum&Help »

Hi Tim,

Thanks for the quick answer. I do like the skin and how it works, except for the issue at hand.

When I modify the default template in the skin and add the following meta tag:

Code: Select all

<meta name="revised" content="<%TOPICLASTEDITED%>"/> 
it ends up in the individual html toc files header, but indeed, not in the JSON topic. So, reading the meta tag value returns only the value of the tag of the default (first) topic.

To solve the issue, I am currently thinking about a post-build process that creates a list of topics vs. the value of topiclastedited and let a postloadfunc script read it out for the loaded topic, but it would be much easier if this variable (and maybe all) <%TOPIC* variable(s) are made accessible, like the TITLE and DESCRIPTION.

What do you think? A useful change in the next release?

Kind regards,
André van den Boogert
André van den Boogert
Realworld Systems
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Show value of TOPICLASTEDITED in footer

Unread post by Tim Green »

Hi André,
What do you think? A useful change in the next release?
We do have this on the ToDo list for a future release but I'm afraid there are other things that currently have priority. It would not just be a change in the skin script. The whole thing would be quite complicated and potentially error-prone:

Since the JSON files are generated by Help+Manual it would also have to include all the topic variables there, and there would also have to be a mechanism for reading them out into the user's own footer code, for example.

You wouldn't be able to just insert a <%VARIABLE%> style variable, as those are only evaluated at publish time. The JSON would have to set variables in the DOM when it is evaluated, and then script would have to find placeholders in your footer code and replace them with the variable values. This would also mean establishing a standard for such placeholders. In addition to this, adding all the possible variables to every single JSON topic would significantly increase the size of the topic code, and this would be unnecessary in most cases, so there would be a lot of redundant code.
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.
User avatar
Olivier Beltrami
Posts: 393
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France
Contact:

Re: Show value of TOPICLASTEDITED in footer

Unread post by Olivier Beltrami »

Hi André,

We have implemented this in our eDoc and website versions, see for example https://www.qppstudio.net/webhelp_xv4/p ... cripts.htm.

We do this by creating a lookup list of all the filenames and timestamps of the XML file of the original HMXP folder, and then copying the entire HMXP folder to a temp folder. Then, for each XML file of the temp folder, we insert the timestamps information just above the </body> tag, as shown below (make sure to read/save as UTF-8).

Code: Select all

    <para styleclass="Normal"><line style="height:1px; color:#c0c0c0;" /></para>
    <para styleclass="Normal"><text style="font-size:8pt; color:#808080;">Topic 087142, last updated on 01-Nov-2020</text></para>
  </body>
</topic>
Then we generate the eDoc and webhelp using the HMXP project of the temp folder.

Works quite nicely.

Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
Post Reply