Single-Sourcing Micro Content Using Variables

There might be times when you want to change the definition to display for a variable, depending on whether it is viewed in a regular topic in the output or when it is viewed as micro content (e.g., in search results). This is possible for linked responses by using micro content variables. It is similar to the snippet variables feature, but is for micro content only.

How to Use Micro Content Variables

  1. Create variables that you plan to use within micro content responses, and add multiple definitions for those variables as necessary. See Creating Variables and How to Add Variable Definitions.
  2. Create a micro content file and create phrases linked to responses. This can be done by tagging content in topics as micro content, or by linking phrases from the Micro Content Editor. See any of the following:
  3. Insert variables as necessary in the responses. See Inserting Variables.
  4. In the Micro Content Editor, right-click the phrase and select Properties.
  5. In the Properties dialog, select the Micro Content Variables tab.

    Note You will not see this option if you haven't linked the phrase to a response. Instead, you will see "Snippet Variables," which can be applied to content entered directly in the Micro Response Editor, just as it can be applied in a regular topic. See Overriding Variable Definitions in Files.

  6. Click the small down arrow on the right side of the variable row, and select the alternate definition you want to use for the micro content.

  7. Click OK.
  8. Click Save the active file. to save your work.

Example You have a micro content phrase called "austin history," which links to part of a topic in your project. Within the response content, you have inserted a variable that has a definition of "University of Texas at Austin."

For the micro content search results, you decide you want to use a shortened version of that—"University of Texas," leaving "at Austin" out of it. Therefore, in the Variable Set Editor, you add another definition for that variable.

Next, you open the micro content file, right-click the phrase, and select Properties.

In the dialog, you select the Micro Content Variables tab. Then, next to the variable, you click the small down arrow and choose the shorter definition.

After you click OK and save the changes, you build the HTML5 output.

When you open the topic in the output, you see the long version of the variable definition.

But when you search for Austin History, you see the shorter version of the definition.