In addition to topic properties available from the table of contents, the Topic properties panel allows you to configure additional information and settings for each topic in your project. These properties are separate from the table of contents structure and provide finer control over how topics behave and how they are processed in generated documentation.

System properties

System properties define core information about the topic:

  • Description - A short description of the topic.
  • Help ID - A unique identifier used to reference the topic in help systems.
  • Help context - A numeric context ID that can be linked to external applications.

HTML properties

HTML properties define settings related to web-based output:

  • Aliases - Alternative URLs that can be used to reference the topic. See: Topic aliases 

Word/PDF properties

Word/PDF properties control formatting for document-based outputs:

  • Page break before - Inserts a page break before the topic when generating Word or PDF documentation.

Custom properties

Custom properties allow you to define additional metadata specific to your documentation needs.

  • You can add new properties using the Add button in the panel.
  • Each custom property consists of a name and a value, which you can edit at any time.
  • Custom properties allow you to associate extra topic-specific information. For example, you can define a property named Reviewer to indicate who is responsible for validating the topic, add a Version property to track when the content was last updated, or create a CustomID property to integrate with an external system.

Accessing custom topic properties in scripting and templates

Custom topic properties can be accessed programmatically:

  • Scripting API - Use HelpNDoc’s scripting capabilities to read or update custom topic properties. This makes it possible to automate tasks such as generating reports or updating metadata in bulk.
  • Templates - Custom properties can also be retrieved from within publishing documentation with a custom template. This allows you to dynamically include property values in generated documentation, providing more flexible and tailored output.

The scripting API makes it possible to query and use custom topic properties in templates. You can call HndTopicsProperties.GetTopicCustomPropertyExists to determine whether a property is defined for a given topic, and HndTopicsProperties.GetTopicCustomPropertyValue to retrieve its content. For example, a template might first check if a property named "Reviewer" exists and, if so, insert its value into the generated output.

Here's a minimal sample script showing how to check for a Reviewer property and retrieve its value using the correct API methods:

if HndTopicsProperties.GetTopicCustomPropertyExists(TopicId, 'Reviewer') then
begin
  var Reviewer := HndTopicsProperties.GetTopicCustomPropertyValue(TopicId, 'Reviewer');
  PrintLn('Reviewer: ' + Reviewer);
end;