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, Keyword names, and so on. During the compilation process, text variables are replaced with their actual values.
System and User-Defined Variables
In your help project, you can use system and user-defined variables:
•A system variable (e.g. #TopicTitle, #Copyright, #Date, etc.) has a pre-defined value.
•A user-defined variable allows you to set any value that you need. The value of a user-defined variable can also contain other system and user-defined variables.
Define Variables for the Help Project
To view and edit the 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.
Editing User-Defined Variables
The Text Variables dialog allows you to switch between system and user variables:
•In the System Variables section, you can view the pre-defined variables available in your help project. You can select a system variable to view its description.
•In the User Variables section, you can add and edit user-defined variables by using the appropriate buttons. In this section, you can also load and save the variables from/to an external file.
Define or Override Variables for Compilation Tasks
If you use the Batch Compilation mode, you can define variables or override the values of existing variables for a specific compilation task.
For example, you can use this possibility if you need to change the values of some variables in a particular version of your help file compiled with the appropriate Build Tags.
Define or Override Variables for Specific Topics
HelpSmith allows you to define variables or override the values of existing variables for specific topics.
For example, you can use this possibility to store some data related to specific-topics, which can be displayed in a template, meta tags, etc.
To edit variables for specific topics:
1.In Project Manager, select the topics for which you want to define variables.
2.On the Project tab, in the Topics & Templates group, click Properties.
3.In the dialog, click Variables.
Remark: To select multiple topics, you can click on the topics while holding down the Ctrl key.
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.
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.
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.
Related Links
Copyright © 2007-2024 HelpSmith.com