Showcase and discover digital art at yex

Follow Design Stacks

Subscribe to our free newsletter to get all our latest tutorials and articles delivered directly to your inbox!

FrameMaker 7.0 Tutorial: Variables and Conditional Text

About Variables

When documenting new products, variables are essential. The names of these products often change several times and are often not established until weeks before a release. Variables allow you to change product names quickly and consistenly across several documents.

FrameMaker provides a default set of system variables, such as dates and file names, and the ability to create user variables. This section discusses user variables.

Creating a User Variable

The best way to manage user variables is to create them within a template for your documentation library. Each document within your library should be based on this template.

In this exercise, you create a user variable within a template.

  1. Open a new document, and save it as a template:
    1. Open FrameMaker, and select File > New > Document.
    2. From the New dialog box, click Portrait.
    3. Select File > Save.
    4. In the File name box, type template for the template name, and click Save.
      Note: If you are working in the TCM computer lab, save the file to your lab account. If you do not have a lab account, please contact your instructor.

  2. Select Special > Variable.

    The Variable dialog box appears.
    Variable dialog box

    You can use the scroll bar to view the existing variables; these variables are known as system variables.

      Note: System variables can be modified, but they cannot be deleted. Also, you cannot use system variable building blocks in a user variable definition.

  3. In the Variable dialog box, click Create Variable.

    The Edit User Variable dialog box appears.
    Edit User Variable

  4. In the Name box, type FM.
  5. In the Definition box, type FrameMaker.

      Note: Variable names are case-sensitive; FM is not the same as fm.

  6. Click Add to store this variable.
  7. Click Done to close each dialog box.
  8. Save and close your template.

Inserting a User Variable

You can now create a new document from your template and insert the variable:

  1. Select File > New > Document.
  2. In the New dialog box, locate and select the template that you just created (

    The file name appears in the Use Template box.

  3. Click New.
  4. Select Special > Variable.

    The Variable dialog box appears.
    Variable dialog box

  5. Within the Variable dialog box, select the variable that you just created, and click Insert.

    Tip: You can also press Ctrl + 0 (zero) to insert a variable. When you press Ctrl + 0, the bottom left side of the FrameMaker status bar becomes highlighted. Press the first letter of the variable to insert. When the variable appears in the bottom left corner, press Enter.

    Status Bar

  6. Select File > Save.
  7. In the File Name box, type variables for the file name, and click Save.

Changing a Variable Definition

To change a variable definition:

  1. Open your template (
  2. Select Special > Variable.
  3. In the Variable dialog box, select the FM variable, and click Edit Definition.
  4. In the Definition box, type 7.0, and click Change.
  5. Click Done to close each dialog box.
  6. Click Save File (Save) to save the template.

Importing Variable Definitions

Once you change a variable definition, you must import it into other documents in your library.

To import variable definitions:

  1. Select Window > to view your document.
  2. Select File > Import > Formats.

    The Import Formats dialog box appears.

  3. From the Import from Document pull-down menu, select
  4. In the Import and Update area, click Deselect All.
  5. Select the Variable Definitions check box, and click Import.
      Tip: You can import individual elements by selecting the appropriate check box within the Import and Update: area, and clicking Import.

The modified variable is updated within your document. To verify, open the Variable dialog box, and display the variable.


Conditional text enables you to support two versions of a document using one set of files. For example, if you create a document that supports two versions of the same product, you can apply condition tags to the text that differs between the products. When you release the document, you show or hide the text based on the condition tags.

Creating Condition Tags

This procedure describes how to create your own conditional tags and edit existing tags.

  Note: If you are working on a book that consists of several files, you should create condition tags in a template and then import them into each book file.
  1. Open a new document, and select File > Save.
  2. In the File Name box, type conditional, and click Save.
  3. Select Special > Conditional Text.

    The Conditional Text dialog box appears.

  4. In the Conditional Text dialog box, click Edit Condition Tag.

    The Edit Condition Tag dialog box appears.

  5. In the Tag box, type product1.
  6. From the Color pull-down menu, select Blue, and click Set.
  7. In the Conditional Text dialog box, click Edit Condition Tag.
  8. In the Tag box, type product2.
  9. From the Color pull-down menu, select Red, and click Set.
  10. Click X to close the Conditional Text dialog box.

Applying Condition Tags

After you create the condition tags, you must apply them to the text:

  1. Type the following text into your document (or create two lines of text on your own):

    Product 1 has a lifetime warranty.
    Product 2 has a limited warranty.

  2. Select the first line of text.
  3. Select Special > Conditional Text.
  4. In the Conditional Text dialog box, select product1.
  5. Click (left arrow).

    Your settings should look similar to the following.
    Conditional Text

  6. Click Apply.
  7. Repeat the previous steps to apply the product2 condition tag to the second line of text.

The condition tags are applied to the text. You text should look similar to the following.

Showing and Hiding Conditional Text

After you apply the condition tags, you can show or hide the text:

  1. In the Conditional Text dialog box, click Show/Hide.

    The Show/Hide Condition Text dialog box appears.

  2. From the Show: column, select product1, and click (right arrow).
  3. Click Set.

    The text for product 1 is hidden. Experiment with conditional text settings; try adding and removing text, spaces, punctuation, and words. Note that when you apply conditional tags to text, it is important to include or exclude spaces, periods, and paragraph symbols to maintain the appropriate formatting whem the text is hidden.

      Tip: Before you release a document that contains conditional text, turn off the conditional text formatting so the text appears normal. To turn off conditional text formatting, uncheck the Show Condition Indicators check box in the Show/Hide Condtional Text dialog box, and then click Set.

This tutorial introduced you to two very useful features: variables and conditional text. By incorporating these features into your documents, you can create and edit documents more efficiently and effectively.