Include keywords at end of topic

Please post all questions on Help+Manual 8 here

Moderators: Alexander Halser, Tim Green

Post Reply
Peter Muckle
Posts: 101
Joined: Fri Oct 18, 2019 9:33 pm

Include keywords at end of topic

Unread post by Peter Muckle »

Hello,

I wondered if there is a way to add topic keywords to the end of each topic (apart from copy/paste).

Thanks

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

Re: Include keywords at end of topic

Unread post by Tim Green »

Hi Peter,
Peter Muckle wrote: Sun Apr 25, 2021 9:22 pm I wondered if there is a way to add topic keywords to the end of each topic (apart from copy/paste).
It depends what you want to achieve: If you want to include them in the search, that is already covered. The keywords are included in searches. If you want to display them as part of the body of the topic you can achieve that in WebHelp and CHM quite easily. You just need to edit the HTML Page Template of your skin (.hmskin file, NOT your project file!) and add the variable that inserts them directly after the variable that inserts the topic content.

Edit the page template in your skin (Configuration > HTML Page Templates > Default), locate the <%TOPIC_TEXT%> variable, and insert the <%TOPIC_KEYWORDS%> variable directly after it, along with any HTML formatting and additional text you want to use. For example.

Code: Select all

<%TOPIC_TEXT%>
<p><strong>Keywords in this topic</strong></p> 
<p><%TOPIC_KEYWORDS%></p>
The keywords are inserted as a comma-separated list in a single paragraph. This can't be changed.
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.
Peter Muckle
Posts: 101
Joined: Fri Oct 18, 2019 9:33 pm

Re: Include keywords at end of topic

Unread post by Peter Muckle »

Thanks Tim,

I am getting keywords for the first topic only, when I check the other topics there are no keywords.

Then when I return to the first topic, the keywords that were there on opening are missing.

This is the code
topic test.PNG
This is a modified Ewriter skin

Thanks for any advice
You do not have the required permissions to view the files attached to this post.
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Include keywords at end of topic

Unread post by Tim Green »

Hi Peter,

Ah, that means you're using a V3 or V4 skin from the Premium Pack. Unfortunately, you can't use topic-level variables in the page templates there. This is because of the way they work: The actual page is only loaded on the first visit to the site. When you browse in the WebHelp, pages you visit are loaded by replacing only the page content dynamically, from a compressed version of the data only. This is how the extremely fast browsing performance is achieved with these skins -- pages load in between 20 and 100-200 milliseconds instead of in a couple of seconds. However, it also means that the variables in the templates aren't available. They are evaluated on publishing only, not dynamically during viewing. For that to be possible Help+Manual itself would have to generate different references to the variables available dynamically, and that isn't there yet.

I'm afraid there isn't a solution to this, because the keywords variable only works in HTML templates, so it's a catch 22 situation. :?
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.
Peter Muckle
Posts: 101
Joined: Fri Oct 18, 2019 9:33 pm

Re: Include keywords at end of topic

Unread post by Peter Muckle »

OK thanks,

Yes I am using a recent skin, for eWriter rather than webhelp though.

I will just have to copy the keywords manually and remember to update them.

Peter
Post Reply