Creating key maps to define key references for variables

Last Updated : Feb 23, 2016 |
Prolog information
Before you begin
Before setting up any key references, consider the variables you need for your project. Create a list of the keys and the possible values. Only define keyrefs for things that require more than one possible value, where the value will be consistent across every use in a particular context.
This procedure provides the steps for defining the key definitions (keydefs) and their associated values in special maps (referred to as key maps).
  1. Create a DITA map to use for the key definitions.
    ADDITIONAL INFORMATION:
    Give the map a descriptive name that’s specific to the context and makes it clear that the map is for keys. You’ll create multiple maps that define the values of the keys for the different contexts in which the keys are used.
  2. Open the DITA Map in Arbortext Editor.
  3. If the map contains a topichead element, delete it.
  4. Put the cursor after the map element, press Enter, and select keydef.
  5. When the Modify Attributes dialog displays, type a name for the key in the keys field and click OK.
    ADDITIONAL INFORMATION:
    This is the name that you’ll use in the topics to point to this key reference. The keynames are case-sensitive and should not include any spaces or special characters.
  6. Position the cursor at the end of the keydef element, press Enter, and select topicmeta.
  7. Position the cursor at the end of the topicmeta element, press Enter, and select keywords.
  8. Position the cursor at the end of the keywords element, press Enter, and select keyword.
  9. Type the value of the key in the keyword element.
    ADDITIONAL INFORMATION:
    This is the value of the keydef that will appear in outputs that include this key map.
  10. Repeat for each key you want to define in this key map.
  11. Check in the map.
  12. Create as many key maps as you need for your project to define the possible key values.
    ADDITIONAL INFORMATION:
    It’s very important that you use the same keydef names in the key maps in which you define different values for the keydefs.
  13. Add a new last chapter to the publication and then add the key map to the chapter and set the format attribute to ditamap like you do for other maps.
    ADDITIONAL INFORMATION:
    The use of the keydef elements signal the processor that the map contains key references instead of topics.
  14. If you want to use the same bookmap and apply different values in different outputs, repeat step 5 for each key map and then apply the appropriate condition to each map.
  15. If you added multiple conditionalized keymaps to your publication, select the Conditions tab in Publication Manager to select the condition to apply.
Next steps
Use the variables (keydefs) in your topics.