A condition is a single-sourcing feature that you can apply to files or to different areas of your content, so that some information displays in some outputs but not in others.
Single-sourcing means to produce multiple results from one source. In Flare, you can make use of single-sourcing in many different ways.
One way to single-source content is to take advantage of multiple output formats and condition tags. How does it work? Each target in your project is a potential output (using a specific output format, such as HTML5 or PDF). You can create and apply condition tags to content. Then you associate the condition tags to your different targets as necessary, so that some content appears in some targets but not in other targets. This way, you do not need to create a separate project for each output that you want to produce. If most of the content for your outputs is similar, there is no need to rewrite it in another project. Simply specify which sections to include or exclude in which targets through the use of condition tags. This is one reason that topic-based authoring is so appealing. By placing condition tags on individual topic files themselves, you can pick and choose which topics to include in some outputs and which to include in other outputs.
Let's say you need to create two PDFs from your project—one for beginning users and another for advanced users. Rather than creating two separate projects, you can put all of the content into a single project.
Then you can create one condition tag called "Beginner Manual" and another condition tag called "Advanced Manual."
After that, you can apply the "Beginner Manual" condition tag to the content that belongs only in the manual for beginners, and you can apply the "Advanced Manual" condition tag to the content that belongs only in the manual for advanced users.
Finally, you open one PDF target and tell Flare to include the "Beginner Manual" condition tag and exclude the "Advanced Manual" condition tag. In the other PDF target, you do the opposite; exclude the "Beginner Manual" condition tag and include the "Advanced Manual" condition tag.
Following are the basic steps involved with condition tags.
- Add Condition Tag Set A condition tag set is used to hold condition tags you create for your project. Flare's factory templates may provide you with an initial condition tag set, which contains different condition tags (depending on which template you select) to help get you started. You can create as many additional condition tags as you want for that condition tag set. However, if for some reason you want more condition tag sets to hold even more condition tags, you can easily add them. Any condition tag sets that you add can be used in the same project and in the same outputs (e.g., if you have 18 condition tag sets, you can use conditions from all of those 18 condition tag sets in the same output generated from a project).
See Adding Condition Tag Set Files.
- Create Condition Tags Within a condition tag set, you can create as many condition tags as you need.
See Creating Conditions.
- Apply Condition Tags to Content After you create condition tags, you can apply them to the appropriate content in your project. You can apply condition tags to many different elements in your project, including files that make up the project (e.g., topics, snippets, images, stylesheets, TOCs, outputs, targets), full paragraphs, text within paragraphs, table rows and columns, TOC entries, and index keyword markers. You can also apply conditions to glossary terms. You can apply condition tags to new files (i.e., in the Add File Dialog), or to existing files.
See Applying Conditions to Content.
- Associate Condition Tags with Targets After creating and applying condition tags, you need to tell Flare what your target should do with the condition tags that you have created and applied. Should content with a particular condition tag be included in or excluded from that target?
See Associating Conditions with Targets.
When you create condition tag expressions, you have the choice of working with conditions in Basic or Advanced mode. You can switch between the two modes by clicking Basic or Advanced in the user interface. You can use Basic if you are newer to condition tag expressions, or you can use the Advanced mode if you are experienced at writing condition tag expressions by hand. While the Basic section is easier for most people to use, it is also more limited in the type of expressions it can create.
You can preview a topic based on the output format used in any of the targets in your project.
When you preview for a specific target, the condition tags set for that target are automatically used in the preview. However, if you want to test the output with certain condition tags included or excluded, click in the Preview dialog. The Conditional Text dialog opens. Either the Basic or Advanced mode is already selected, depending on which mode is being used in the target. You can use the same steps that are used in the target for including and excluding certain condition tags.
Changes in the Preview window pane are not transferred to the target settings. They're simply temporary so that you can see what a topic looks like with certain condition settings.
When adding a new file to a project, you can associate conditions with that file. This will save you time because you will be able to make sure that all of your new files created from the Add File dialog are conditioned when you create them, rather than having to go back and add condition tags to them later.
In the Add File dialog, expand the Attributes area at the bottom. Then next to the Condition Tags field, click and select the relevant conditions.
When editing a document in the XML Editor, you can click in the local toolbar to open the Conditional Text dialog and include and exclude conditions on that file. This is similar to the feature that you can use to preview a document with certain conditions set
Note: As an alternative to the condition preview button, you can click the topic preview button to see how the topic will look with different condition and target settings.
Normally you would apply a condition to a piece of content or a file. But in Flare you can also set conditions on styles and then apply those styles to content. This is simply another alternative and might be more efficient for some authors. You might even find that you use both methods in your projects.
In the Advanced view of the Stylesheet Editor
Let's say you have created a lot of drop-downs throughout your project. But you want the heading portion of the drop-down to display only in online outputs, not in any print-based outputs.
Of course you can manually apply conditions to your drop-down headings, but you would have to do that each time you create a drop-down. A better option is to apply a condition to the style used for the drop-down headings.
So you open your stylesheet and select the MadCap|dropDownHead style. And then in the mc-conditions property you select a condition that you've created for the purpose of online only outputs.
As a result, the online only condition will automatically be applied to any drop-downs you've created in the past, and any that you create in the future.
So when you build online output, you will see this:
And when you build print-based output, you will see this:
Note: Conditions that are set locally (i.e., directly on content) will override conditions set on a style. Even if the local condition is empty, it still overrides the conditions set from stylesheet.
Note: When you set a condition tag on a style, you can optionally use the mc-exclude-action property to set an exclude action on the tag. For example, you might have the unbind action for a condition tag if you have applied the tag to a hyperlink and want the link to be removed from the text in some outputs, but you still want the text to be shown in those outputs.
You can include or exclude content in files sent for review based on condition tags.
Toward the bottom of the wizard, you can click . The Conditional Text dialog opens.
You can include or exclude conditions in a couple of different ways. You can even use both:
- Target Settings The easiest method is to click the Target Expressions drop-down and select a target in your project. The dialog is automatically populated based on the included and excluded conditions in that target.
- Manual You can also complete this dialog manually. You can use the same steps that are used in the target for including and excluding certain condition tags.
For more information about the Basic and Advanced modes, see Creating Basic and Advanced Tag Expressions.
Let's say you have a topic that looks like this, with four different conditions applied to content:
In the Conditional Text dialog accessed from the Send Files For Review Wizard, you select Target Expressions and choose PDF/UserGuideA7X9.
When the reviewer opens the file, this is what is shown:
Note: If you have already associated conditions with a file while editing in the XML Editor
If you are tracking changes in Flare and make changes to your condition tags, you can preserve the tracked changes when you build Word output. This will let you see the changes you made to your condition tags in your final Word output.
Note: You can see tracked changes to condition tags in PDF output if you enable change bars. However, condition changes are not explicitly marked in the output, and could be missed if there are other changes to the paragraph that would also enable a change bar.
You can export project files and content based on conditions that you create. One reason you might want to use this feature is to quickly and easily archive projects, especially if you have an extremely large Flare project and need to archive only parts of it. Another use for this feature is translation. If you only need a portion of a master project to be translated, you don't want to send the translator all of the files, but rather a smaller version of the project containing only the files requiring translation.
There may be times when you have an undefined condition tag in your project. For example, you might have a condition tag that you've applied to content and then included or excluded in some targets. But then you delete that condition tag for some reason. In that case, there are still references to that deleted condition tag in topics or targets, but the condition no longer exists in the tag set, so it's considered an undefined condition tag. If this occurs and you open the Conditional Text tab in the Target Editor (or the Properties dialog for a topic in the case of snippet conditions), you will see a reference to that undefined condition tag in the Basic view. You can then remove the reference to the undefined condition tag.
If you are also using MadCap Mimic or Capture (or both), you can use condition tags that exist in your Flare project. This is similar to the variable integration that exists with these products.
Let's say that you have created two condition tags in a Flare project in order to send parts of your content to different outputs—one condition tag called "Beginner" and the other called "Advanced."
Now suppose you insert an image into that Flare project and then open the image in Capture in order to edit it. Because you inserted the image into the project, a connection already exists between the Flare project and the image while you work on it in Capture.
This means that if you attempt to apply condition tags to the image while it is in Capture, you will have access to the "Beginner" and "Advanced" condition tags that you created in the Flare project.
For more information see the online Help provided with Mimic and Capture.
Note: One way to completely exclude content from online output is to place condition tags on the topic files and include or exclude them from the targets. Another method is to use an option in the Target Editor to exclude all content files unless they are directly or indirectly referenced from the target. This means that if the target is using particular files such as a table of contents (TOCs), master page, and so on, other files linked directly or indirectly from them will be part of the output.
Note: Condition tags are not supported if you are generating a target using the DITA output type, in the sense that you cannot include or exclude condition tags for that DITA output. Therefore, when you open a DITA target, the options in the Conditional Text tab are disabled. However, DITA-specific condition tag attributes are preserved in Flare when you import from DITA; the DITA attributes are converted to condition tag sets in Flare. In fact, you can create custom condition tag sets in Flare that can be useful when you generate DITA output from Flare. You simply need to make sure that the condition tag sets follow the established DITA naming conventions for those attributes: condition tag sets can be named "audience," "product," "platform," "props," and "otherprops." When you generate the output, the condition tag sets are converted to the appropriate DITA attributes.
Note: You can use the MadCap|conditionalText style in a stylesheet to modify the look of content in the XML Editor that has a condition tag applied to it. For example, you might want conditioned content to stand out with a larger font so you can easily spot it while editing content. This does not affect the output.