Editing, formatting and disabling variables
This topic describes how to edit variables in the Help & Manual editor, how to format the content of variables in your output (i.e. with bold text or text styles) and how to disable variables so that the variable name is displayed in your output instead of the content of the variable.
You can create user-defined variables in two modes: As plain text or as HTML code. If you set the variable to HTML mode you can include any HTML code, JavaScript and CSS you like as long as the syntax is correct. You are responsible for this – no syntax checking is performed! HTML variables will only insert the full HTML code in HTML templates and HTML code objects. In other locations only the plain-text portion of the variable value will be inserted. If there is no plain-text portion nothing will be inserted. |
In the Project Explorer go to Configuration > Common Properties > Text Variables and edit the values of the variables in the list. If the variable value is grayed out it is protected and you must first unprotect it by setting the protected switch to No in the Protected column.
You can also double-click on a highlighted button variable in the editor and then select More... to display the variable editing window. (This is not possible with manually-typed variables without a button highlight.)
|
You cannot edit the names of variables in your variable definitions – they are fixed there and to "edit" the name you need to create a new variable with the desired new name. This section is about editing the names of variables that you have inserted in the topics in your project. Variables in your project are actually always just plain text variable names identified by the tag delimiters <% and %>. When you use the Insert > Text Variable function the variables are displayed as highlighted buttons for easy identification and you can double-click on them to display the variables list, but this is just for convenience. You can also type in variables manually. The clickable highlight is just an editing convenience to make the variables easier to see and use. Editing the names of variables inserted with the Variable tool:
Editing the names of variables typed manually: Variables typed manually are normal text and their names can be edited normally. They cannot be highlighted and you cannot double-click on them to display the variables list. Highlighted variables at the beginning of a paragraph: If a highlighted variable is at the beginning of a paragraph you can't insert any text before it; all the text you type to the left of the variable will also be highlighted. Here is how to solve this problem:
If you type text instead of pressing the space bar it will be highlighted as a variable. To correct this just right-click on the highlight and select Convert to plain text. |
The values of variables are stored as plain text, without any formatting information. However, you can easily turn the content of variables into formatted text with bold, underline or styles in your output by formatting the variable name in the Help & Manual editor. Formatting variables manually:
Formatting the variable formats the variable Be careful to select the entire variable – if you only format part of the variable it can no longer be identified correctly by the compiler!
Formatting variables with styles: If you include variables in paragraphs that use paragraph and font styles you don't need to do anything – the variables' values will automatically be formatted like the rest of the text in the paragraph. If you have defined text-only styles (see Defining styles) you can apply them to variables:
Here too, be extremely careful to select the entire variable – if you only format part of the variable it can no longer be identified correctly by the compiler!
|
Sometimes you may want to include the variables themselves rather than their values in your output. For example, this was necessary in this help in all the places where examples of the variables are displayed – if we had not disabled the variables here the values of the variables would have been displayed and the examples wouldn't have made much sense!
Examples:
|
The highlight displayed for variables inserted with Insert > Text Variable uses the same system as the highlighting used for hyperlinks. You can turn the highlight off by right-clicking on the variable and selecting Convert to plain text in the context menu displayed. The variable will still work when you do this, but it is then just like a manually-typed variable. You can no longer-double click on it to display the variables list. This is not reversible! You can undo it with Ctrl+Z or |
See also:
Variables and Conditional Output (Reference)