Skriftlig Info ➜ DITA publishing ➜ DITA variables ➜ Defining a variable in a library topic
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. A suitable folder is available in the database structure.
The library topic you will make must only be used to define variables. You cannot use the same library for both variables and text fragments. |
You can make a new library in one of the following ways:
You can duplicate an existing library and change the variable definitions and/or the values.
This existing library already contains the correct variables, but they have the wrong values.
You can define the variables using a library template.
The template contains predefined variables, but not necessarily the variables you need, You also need to assign the correct values.
You can create a new library from scratch and type in the necessary elements and attributes manually.
This library is initially empty.
A copy of the existing library is established.
Make sure you do this with the new library! You must not change the old!
In the dialogue box that opens, fill in all relevant fields with metadata.
Follow the rules for metadata. Identifiy the new library so that it is easy to see that it is used to define variables.
Assign the new values.
The tags look like this:
<keyword varref="VARIABLE"> VALUE </keyword>
In the dialogue box that opens, fill in all relevant fields with metadata.
Follow the rules for metadata. Identifiy the new library so that it is easy to see that it is used to define variables.
Change the relevant variable definitions by altering the varid attributes and providing new values.
The tags look like this:
<keyword varref="VARIABLE"> VALUE </keyword>
In the dialogue box that opens, fill in all relevant fields with metadata.
Follow the rules for metadata. Identifiy the new library so that it is easy to see that it is used to define variables.
Define the variable by setting the varid attribute and providing the requested value.
The tags look like this:
<p> <keyword varref="VARIABLE"> VALUE </keyword> </p>
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.