Navigation: Getting Started >

Text Variables

Send comments on this topic.

  

 

HelpSmith allows you to use variables in the text of help topics or templates, and almost in any text value that you can define in your help project such as the text values in the project options, topic properties, properties of Table of Contents items, Keyword names, and so on. During the compilation process, text variables are replaced with their actual values.

 

System and User Variables


HelpSmith variables are divided into two types: system variables and user variables.

 

To view and edit variables of your help project:

1.On the Project tab, in the Project group, click Project Objects.

2.In the drop-down menu, click Text Variables.

 

The Text Variables dialog allows you to switch between system and user variables.

 

System Variables include variables such as current date, topic title, project copyright, and so on. You can select a system variable at the dialog-box to view its description.

 

On the User Variables section, you can add, delete, and edit custom variables and their values by using the appropriate buttons. The value of a user variable can include other system and user variables like most of the other text parameters in HelpSmith.

 

Also, in this section, you can load and save your variables from/to an external file.

 

Insert a Text Variable in a Topic or Template


1.In the word processor, put the cursor where you want to insert a text variable.

2.On the Insert tab, in the Placeholders group, click Text Variable.

3.In the drop-down menu, click Insert Text Variable.

4.In the Text Variables dialog, select the variable that you want to insert.

5.Click Insert.

 

The Text Variables dialog box

 

Using Text Variables in Text Fields


You can use text variables in most text parameters of your help project. The syntax that you should use to insert a variable is as follows:

 

Some text %VariableName%,

 

where VariableName is the name of a variable listed in the Text Variables dialog box.

 

If you are using a system variable such as #Date or #HelpTitle in the value of a text parameter, please note that the variable name always starts with the # character.

 

Using Text Variables in HTML Code


You can use text variables when editing HTML code with the built-in HTML Editor. The syntax that you should use to insert a variable is as follows:

 

<%#VariableName%>,

 

where #VariableName is the name of the variable that will be replaced with its actual value during the compilation.



Copyright © 2007-2019 HelpSmith.com