In post 1, I said that you can create one source of content and
use it for multiple outputs, or select a sub-set of the content for each
output. This is one of the foundation concepts of single-sourcing.
Let’s say that you create a sales procedure manual for use in
the US and Canada. Some of the material applies only to the US, some applies only
to Canada, and some applies to both. You could generate one manual that
contains all the material and tell US users to ignore material that applies only
to Canada and vice versa. A better solution is to extract the common material
and the US material to create the US manual, and the common material and the
Canadian material to create the separate Canadian manual.
This capability is driven by conditionality, one of the core
features of single-sourcing.
Conditionality
To repeat my initial description from the first post,
conditions are essentially categories. To repeat the US/Canada example above –
let’s say you have to create a sales procedure manual for use in the US and
Canada. Some of the material applies only to the US, some applies only to
Canada, and some applies to both.
Conditionality lets you define categories of “US only” and
“Canada only”. (Material common to both, or all, categories is always used so
it’s not conditionalized.) When you generate the US output, you’d tell Flare to
exclude any content categorized as “Canada only”. The output would contain the
common material plus the US material but not the Canadian material.
You can apply multiple conditions to material. For example, say
that the sales procedure manuals will not only include material specific to the
US and the Canada but also slightly different material in the online and print
versions. So, to create the online sales manual for the US, after applying appropriate
conditions to the appropriate material, you’d tell Flare to exclude any
material categorized as “Canada only” and any material categorized as “print
only”. The resulting output would contain the common material plus the US
material and online material but not the Canadian or print material.
In addition to controlling the behavior of topics, conditions
can have wider effects. For example, say that you create a general table of
contents that lists topics A, B, and C. The actual topic C is conditionalized
as “Canada only”. When you tell Flare to exclude “Canada only” material when
generating the US output, it excludes the topic and automatically removes it
from the table of contents as well. And if topic A has a hyperlink that points
to topic C, Flare automatically turns that hyperlink into regular text in order
to avoid a broken link.
Conditions are very flexible. You can apply one or more of
them to a topic or multiple topics and to any content within a topic, as finely
as a single character. You can also apply them to any other project element –
images, master pages, stylesheets, and even to other conditions. (Although I’d
have serious reservations about doing that in real project.) This flexibility makes
them very powerful but also requires that they be used and managed carefully.
The two problems that I most often see with conditions aren’t
technical but rather ones of management and design.
- The first problem lies in not documenting the
logic behind the conditions clearly or at all. When the initial author leaves and
a new author comes on the project, they may send the project off the rails
because the lack of documentation makes it easy to make mistakes when applying
or invoking conditions.
- The second problem is the rapid growth of permutations as you add conditions to a project. With one condition, for example, there are only two permutations – include or exclude. With two conditions, however, there are four permutations – include/include, include/exclude, exclude/include, and exclude/exclude. With three conditions, eight permutations. And so on. It’s easy to get confused when to include or exclude multiple conditions in combination. And it’s easy to get confused as to when to apply them at all. The solution ties back to that for the first problem – document the logic behind when to apply conditions in a project and when to include or exclude different conditions in what combinations.
When might you use conditions in a project?
- Some uses are obvious – If you have to categorize material in a project as applying to the US or Canada, for example. A similar example would be to categorize material as applying to system administrators, professional users, or clerical users. When generating output for clerical users, you’d then exclude material conditionalized as “system administrator only” and “professional users only”.
- Another use is to document a project for new authors to reference or current authors to get up to speed after being off the project for a while. You can document a project in a separate Word document, for example, but that might get lost. A better approach is to document the project in topics that are part of the project and with authors notes inserted in specific topics. But you don’t want users to see this material, so you create an “author’s notes” condition, apply it to the topics and the in-topic notes, and then exclude that material when generating the output.
- Another use is to control which topics are made available to the reviewers. You could include all the material in the output and add instructions telling the reviewers to ignore topic 10 because it’s not finished. The problem is that some reviewers may not read the instructions, review topic 10, and give you scathing feedback about how topic 10 isn’t finished. You can avoid this by creating a condition called “not ready for review”, applying it to topic 10, and excluding the “not ready for review” condition on output.
That’s it for conditions. Next up – placeholders (aka
variables and snippets).