User-defined variables

Adobe recommends

RoboHelp User Defined Variables - TechTotal (1:14)


Click to watch a video on creating user defined variables in RoboHelp 9.

Have a tutorial you would like to share?

User-defined variables store static global information that can be used repeatedly in your project, making information portable and simple to update. When you modify a variable or value, every occurrence of that variable or value is updated across the project. The User Defined Variables pod (available from View > Pods) lists all the user-defined variables in a project.

You can import documents with variables into a project.
Note: When you upgrade from previous versions of RoboHelp, variable values are converted to HTML text, and these variable values appear in the Default Variable Set.

Create a user-defined variable

For global variables, ensure that all required variables exist.
  1. Do one of the following:
    • Select View > Pods > User Defined Variables.

    • Right-click a word in the topic. Select Add To > User Defined Variable.

  2. Enter a variable name and value.

    Variable names can contain only alphanumeric characters, underscores, and hyphens, and can't exceed 255 characters. A variable value can be blank.

  3. Click OK. The variable is inserted.

Press Ctrl+F9, and then specify the variable name within the curly brackets that appear in the topic. Double-click the variable to specify its value in the Variable dialog box.
Note: You can create variables only in Default Variable Set, but you can modify the variable value in other variable sets.

Create a variable set

Variable sets enable you to modify values of various user-defined variables and use them in different outputs.

Default Variable Set is the master variable set. When you insert a variable, the variable is taken from Default Variable Set.

You can create different variable sets in the User Defined Variables pod to override the values of variables in Default Variable Set and use them in different outputs. To use a variable set other than Default Variable Set, select the variable set in the Content pane of layout properties.

  1. Click the Add/Edit Variable Set icon.

  2. Click Add and specify a name for the new variable set.

  3. Click OK.

Note: You can edit and delete a variable set in the Variable Set dialog box by clicking the respective buttons.

Edit a user-defined variable

  1. In the User Defined Variables pod, select a user-defined variable from the Default Variable Set.

  2. Do one of the following:
    • Right-click and select Edit.

    • Select and edit its value in the User Defined Variables editor.

    • From the Edit menu, select Edit [variable name].

  3. (Optional) Select a different variable set.

  4. Modify the value.

  5. Click OK.

Note: You can format a user-defined variable in the User Defined Variables editor. The Design and HTML buttons in the editor allow you to toggle between Design Editor and HTML Editor.

Format a user-defined variable

You can format variable values in the User Defined Variables editor. You can also achieve the following using Design Editor:

  • Insert images, hypertext links, and multimedia files in the variable values.

  • Apply conditional build tags to the values.

  • Perform a spell-check on the variable values.

Insert a user-defined variable

You can drag a user-defined variable from the User Defined Variables pod to the desired location in a topic open in Design Editor. If the list of variables is long, specify the variable name or value to search the variable. You can also insert variables using the follow steps:

  1. Place the insertion point at the desired location in a topic.

  2. Select Insert > User Defined Variable.

  3. Select a variable and click OK.

Specify the variable name or value to search the variable. As you type your search string, RoboHelp narrows down the variable list.

View properties of a user-defined variable

  1. In the User Defined Variables pod, select Default Variable Set.

  2. Select a variable.

  3. Do one of the following:

    • Right-click and select Properties.

    • Select Edit > Properties.

  4. View details (Variable Name, Variable Set, Variable Value, Description, and Used In Topics).

  5. Click OK.

Delete a user-defined variable

  1. In the User Defined Variables pod, select Default Variable Set.

  2. Right-click a user-defined variable, and select Delete.

  3. Select one of the following options:

    Delete Variable And Its References
    Delete the variable and its references across the topics, TOC, index, SSL, and templates. No warning is shown before the deletion.
    Note: Use the Variables report to locate the variables you want to remove.

    Delete Only The Variable
    Delete the value of a variable locally. Deleting a user-defined variable in the TOC does not remove it from the index.
    Note: If the variable value is overridden in the Single Source layouts file, it is removed from the variable list in the Single Source layouts dialog box.

    Delete Variable And Replace With Actual Content
    Delete the variable across the topics, TOC, index, SSL, and templates. The formatting rules for the variable remain the same.

Rename a user-defined variable

When you rename a user-defined variable, all instances of the variable are updated across all the variable sets, the topics, templates, TOC, index, and SSL.

Note: You can’t modify saved variable names.
  1. Select View > Pods > User Defined Variables. The User Defined Variables pod appears.

  2. Right-click a variable and select Rename.

  3. In the Variable Name field, enter a name.

  4. In the Variable Value field, modify the value.

  5. Click OK.