Use Filtering features to conditionalize content.
Filtering is a powerful capability in DITA that enables you to identify content that should only appear in certain versions of your output.
Let’s look at some examples of when to use profiling and filtering:
You are documenting a software package that has different features or functionality for the Windows and Linux platforms
You are creating an electronic document output that hides complex technical information from basic users but displays it to advanced users
Your company produces vehicles with the driver controls on the right for some markets and on the left for others.
Instead of keeping two separate document sets for the content, you can keep the content in one topic and identify attributes for the elements. These attributes are used to include or exclude the content during output.
DITA provides several built-in attributes for specifying the Audience, Platform, Product, and Other Properties for an element in a topic or an element in a map. These are called Select Attributes, or selectatts for short. They are essentially predefined attributes in DITA that you can set to any value. For instance, you can set the Audience selectatt to “Novice” or the Platform selectatt to “Windows”.
At publish time, you can define the values for each selectatt that you want to apply using a DITAVal file. A DITAVal file can contain sets of variables and configuration information that you want to use whenever you publish a DITA map, including selectatts, output formats, and locales.
Filtering at the Element Level
You can filter elements in a topic using the Properties Pane in the Topic Editor. For example, you can select a bullet list and modify the Audience to “Novice”, so the bullet list will only appear in the output if the Novice Audience is configured to be included.
To learn more, see Filtering Elements in a Topic.
Filtering Entire Topics or Sections of a Map
You can also filter an element in a map using the Edit Properties window in the Map Editor. For example in the element’s properties, you can modify the Product to “Mobile”, so the topic will only appear in the output if Mobiles Products are configured to be included.
To learn more, see Filtering Entire Topics or Sections of a Map.