Help Producer supports both global variables and topic variables, which can be used to create attributes on a project or per topic basis. Topic variables allow you to associate custom attributes to a topic, making it ideal for customization in combination with HTML templates.

Global variables are set in the Variables property page of the Help Producer Project Editor, and used for all topic pages. Topic variables are local to topic pages, and are set by inserting the Help Producer Set field. These variables can be accessed by the script inside the template to customize the generated output. For details on the Set field, see the topic Set Field.


For instance, assume that you need to change the topic page's layout depending on the topic type. You could define a topic variable TopicType that you set inside a topic by inserting the following field:

In the following example, the HTML template checks the variable TopicType and generates different code depending on the topic type:

<% if (ActiveTopic.Variables.GetValue("TopicType") == "Task") { %>
   This is a task topic.
<% } else { %>
   This is not a task topic.
<% } %>

See Also

Customizing Help Files | Help Producer Object Model | Set Field