You can also use all the global predefined variables and your own user-defined variables in the captions in the Table of Contents, keywords, image captions, link captions, macros and scripts, HTML code objects, HTML templates, PDF print manual templates and text entry fields in your project's Configuration section.
There is one difference, however: In all these locations you cannot use the
tool, you must type the variables in manually.
If you use HTML variables anywhere except in HTML templates and HTML code objects only the plain-text portion of the variable value will be inserted. If the variable does not contain a plain-text portion nothing will be inserted.
•Go to in the Project Explorer to view and edit your user-defined variables.
•See global predefined variables for a list of the available predefined variables. |
1.In the Project Explorer, click on the TOC entry you want to edit and press to activate caption editing.
2.The variable insertion dialog used in topics is not available here! Type in the variable exactly as it appears in the variable list.
Examples:
<%DATELONG%>
|
A predefined variable (the date in long format)
|
<%MYPROJECT%>
|
A user-defined variable
|
|
Text variables are supported both in normal index keywords and in A-keywords.
•The procedure here is exactly the same: Just type in the variable, entering it exactly as it is listed, complete with the opening <% tag and the closing %> tag.
See Keywords and Indexes for details on editing and using keywords.
|
1.Double-click on the graphic in the editor to open its properties dialog.
2.Type in the variable in the Image Caption field, entering it exactly as it is listed, complete with the opening <% tag and the closing %> tag. |
You can also use text variables in link captions, i.e. the texts of hyperlinks shown in your topics. You can edit these directly, just by clicking once in the caption and typing, but it is still a little easier to double-click on the link to edit it in its properties dialog.
1.Double-click on the link to display the Hyperlink dialog.
2.Type in the variable in the Caption: field, entering it exactly as it is listed, complete with the opening <% tag and the closing %> tag. |
You can also use text variables in macros and scripts inserted in macro and script links and graphics hotspots.
HTML variables are supported in scripts.
•Just follow the instructions for inserting macros and scripts in macro and script links and graphics hotspots and type the variable in the Script: editing field in the place where you want to use it, entering it exactly as it is listed, complete with the opening <% tag and the closing %> tag. |
Both text variables and HTML variables are also supported in HTML code objects inserted with tool in
•Here too, just type in the variable in the code object using the standard syntax and the opening and closing <% and %> tags around the variable name (spaces are permitted in variable names). The variables will be parsed and replaced automatically when you publish your project.
Remember that no syntax checking is performed on the contents of HTML code objects; you are entirely responsible for the proper syntax and structure of your HTML code!
Important: You cannot use HTML template variables in HTML code objects because the code objects are parsed together with the topic content, before it is inserted in the template.
See The power of editable variables for some powerful additional features available with HTML variables!
|
A number of the predefined variables in Help+Manual enter the current date or time or the date or time associated with an item in your project. Normally these variables will automatically use the date and time format set in your Windows configuration. In addition to this they also automatically use the current language set in your project for words in the time and date, if applicable.
However, the <%NOW%>, <%TOPICLASTEDITED%> and <%DATE%> variables also support the use of a "format string" with which you can define the entire date and time format to be displayed. You define the format by adding the format string to the variable in parentheses like this:
<%NOW(dddd, mmmm d, yyyy)%>
See Date and time variables for details of the syntax.
Note that this only works with these three variables. If you add format strings to any other variables the variable will no longer work. Also, you can only use this option by editing variables in the Help+Manual editor. You cannot use the date and time formatting syntax in variable definitions.
|
See also:
Variables and Conditional Output (Reference)
Date and time variables