Skriftlig Info ➜ DITA publishing ➜ DITA variables ➜ Inserting a variable from a topic map
DITA variables
Variable definitions using library topics
Variable definitions using topic maps
Prosedyrer
Defining a variable in a library topic
Inserting a variable from a library topic
Inserting the library topic into the publication
Defining a variable in a topic map
(This procedure is based on the Tridion Docs database repository and Oxygen XML editor. Other tools have similar functionality.)
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.
You can insert a variable from a topic map in one of the following ways:
You can copy the variable from another topic or library topic.
It will still be provided with the correct value when the document is published.
You can insert the variable manually.
It is enough to insert the variable, since the value will be inserted when the document is published.
In the procedures, descriptions and examples I use the <keyword> element. In many DITA systems, you can also use other elements. The elements must be defined in the system files that control the publishing system's functionality. Check with your system supplier for more information about this.
I recommend that you standardize the use of the <keyword> element for variables. Although it is permitted to use other elements, it is easier to be consistent. This consistency increases understanding in the team and facilitates maintenance. Especially for new users, it will be easier to identify which elements are variables and which are not.
TipTo identify the topic map I use to define variables, and make it easier to find, I refer to it as a "keymap". This is not a standard DITA designation. In your database system, I suggest that you establish "Keymap" as a map type in your metadata. Unique identification makes the topic map easier to find. |
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.
Change the keyref attribute to contain the correct variable name.
You must use the correct name. Note that this name is case sensitive.
TipConsider 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.