Skriftlig InfoDITA publishingDITA variablesInserting a variable from a library topic

Inserting a variable from a library topic

Any variable defined in a library topic can be used inside a text fragment in topics and other library topics.

(This procedure is based on the Tridion Docs database repository and Oxygen XML editor. Other tools have similar functionality.)

On this page

Prerequisites

You have all the tools available, and the necessary rights to develop new content.

You must know the correct name of the variable. Note that this name is case sensitive.

Context

You can insert a variable from a library topic in one of the following ways:

Procedure

Tridion Docs / Insert variable
  1. Check out the topic or library topic in which you want to insert the variable.
  2. Place the cursor in the requested position in the text.
  3. To fetch the variable from the library topic in which it was defined:
    1. From the editor's main menu, select Tridion DocsInsert variable.
    2. Locate and double-click the library topic that contains the requested variable definition.

      You can insert the variable from any library topic, since the value you have defined for your publication is inserted when the document is published.

    3. Click on the requested variable, and then click OK.

      Tridion Docs / Insert keyword

    4. Click Insert.

  4. To copy the variable from another topic or library topic:
    1. Open the topic or library topic from which you can copy the <keyword> element.
    2. Copy the <keyword> element and paste it into your own text.

      The value (content) of the variable is not significant. The correct value will be automatically inserted when the document is published.

  5. To insert the variable manually:
    1. Create a <keyword> element.
    2. Change the varref attribute to contain the correct variable name.

      You must use the correct name. Note that this name is case sensitive.

Tip

Consider building a modular system with variable definitions. This allows reuse of definitions and values, and provides a high degree of consistency.

These pages only explain how variables are used in DITA publishing. If you want additional explanations about the principle of variables, see under Methodology and especially Using variables in the text.


All external links open in a new window. I take no responsibility for information on external websites, even if I have linked to them. Please report links that do not work.

The information on this page represents my personal opinions and my understanding of the topic being described. Feel free to link to the page, but do not copy large parts of the content without permission. I take no responsibility for any errors, misunderstandings or missing information. I also take no responsibility for any mistakes you may make or cause as a result of incorrect or missing information. You are welcome to contribute with comments, relevant experiences or additional information. See Editor and contact information.