RoboHelp 2019 - Variables

Variables allow you to enter a string that can be inserted in topics, topic titles, master pages, snippets, index entries and a table of contents. They are used where the string could change in the future. Company and product names are good examples. Instead of having to edit every place the company or product name is used, you insert a variable. When the value of that variable changes, you change it once and it cascades to wherever you have used it.

Another scenario is where you need to change the string in different outputs. For example, you might want one output for your US customers, one for your UK customers and one for your Canadian customers. You can create Variable Sets to create different outputs.

Adding a Variable

To add a variable, click the + icon and enter the name and default value for the variable. To edit or delete it, click the menu that appears when you hover over the variable. You can also double click to edit.

The name of the variable no longer has to include an underscore.

To use the variable, just drag it to where you want in the topic or press CTRL + 1 to display a dialog with the variables listed.

To add a variable to the Title of an Output, place the cursor where you want the variable press CTRL + 1 to display the dialog.

Formatting Variables

If you enter a simple string into the variable, it will take on the format of the paragraph it is in. In the Warning - Normal variable shown below which does not have any inline styling in its value, it has taken on the normal paragraph style. You can apply any style or class to a particular instance of the variable.

In the Warning - Red variable inline styling has been applied so the variable will always show "Warning" in red. Again you can apply a style or class to a particular instance of the variable.

Warning - Red has to be written as you see it below. If you are not sure what HTML is required for your variable, create it in a topic, switch to code view and copy/paste it from there.

In your output it will look like this.

Variable Sets

Having created your variables with their default values, the next stage is to create the values that will vary.

Let's say the default values are for US users, in Output mode you click Variable Sets and click the + icon to create say UK Values. All the variables you have created will be listed and you can apply the UK values.

Repeat the process for all the sets you require.

Later if you tick the check boxes, a Reset button allows you to revert any or all the values to the default values so that you can start again.

The Sets are selected when you configure an output.

Donations

If you find the information and tutorials on my site save you time figuring it out for yourself and help improve what you produce, please consider making a small donation.