There are two different types of variables:
• Text Variables
• Rich Content Variables
Both types allow you to manage content in one place for reuse across your project. You can use Text Variables for any amount of unformatted text or Rich Content Variables for blocks of formatted content. Variables are commonly used for text that can change frequently, such as product or company names — or larger chunks of text, such as tables. Both types are created/edited from the Variables node of the Project Editor.
Text variables can be one or more words, and take on the formatting of their insertion point in the source document. They are stored within the project and can have conditions applied to them. Each text value can have multiple text/condition pairs. If there are multiple values, the one which has its condition satisfied for the target is used. If no condition is satisfied, the text without condition is used. Text without condition can be used as a default for targets that don’t satisfy any of the conditions used for the same variable.
Rich Content Variables
Rich content variables are defined in special source documents. The formatting in those documents will be retained when the target is compiled. You can have multiple variable definition documents in your project.
Creating a Variable
To create a variable, click on the Variables node of the Project Editor.
Rich Content Variables:
Please note that you can define a variable in Word, and use it in an HTML source document, or define a variable in HTML, and use it in a Word source document.
1. Click on the Add button in the Rich Content Variable area. A New Document dialog box will open. Enter the Document Name (Word or HTML) and click OK to add it to your project.
2. Right-click on the document name in the Variable window and choose Open variable definition document. The document will open. The Variables document will have a table with two columns in it.
3. Enter variable names in the column on the left, and the formatted variable content in the column on the right.
4. Save the document.
1. Click on the Add button in the Text Variables area. The Add Variable dialog box will open.
2. Specify a Name for the variable, then enter the Text (one word or many). If you’d like, specify a Condition for the variable. Click OK.
To use a variable, open your source document (Microsoft® Word, Microsoft® FrontPage®, or Adobe® Dreamweaver®), select the hotspot text, and click the Variable button (or use the shortcut Alt+Ctrl+B).
The Variable dialog box will open, where you can enter a variable name or select it from a list using the Browse button.
A D2HML Variable hot spot is created. The style is the D2HML style C1H Variable. See Exploring the D2HML Styles Toolbar.
When your help target is built, the value of the variable(s) used is automatically inserted in the target. For text variables, the value will have the same formatting (font, etc.) as its insertion point. For rich content variables, the variable will define its own formatting.
Please note that when you insert Rich Text Variables using the Select Variables dialog box, the variable names created in the document will appear on the left, and <rich content> will appear on the right.