Share:
ClickHelp Documentation

Conditional Content

ClickHelp supports conditional content. It means that parts of your content can be present in one output and excluded from the other.

For example, you can have instructions for administrators exists in the topic meant for the general audience, and it will be excluded from the PDF you send out to your readers, but present in the online publication, accessible by administrators only.

You can easily manage your conditional content blocks using the Design View. Specifically, the "Conditional Content" section of the Single-Sourcing tab in the ribbon.

Let's see what this section is comprised of:

  1. Output Tag selection field — You will need to choose at least one tag to be able to insert conditional content or convert existing content to conditional.
  2. About — Link to this topic.
  3. Manage Tags... — Opens Output Tags settings. 
  4. Make Including Make Excluding — Makes currently active element or the common parent element of selected elements conditional.
  5. Insert Including / Insert Excluding — Inserts a conditional block of the specified type with either the default content or with the selected content.
  6. Clear Conditions — Clears conditions on the currently active element or within a selection.

Insert Including / Excluding

This commands will insert a block-level element with some default content to a position of the cursor. 

If you have a selection and press "one of these two options, the content of the selection will replace the default content in the conditional block.

Make Including / Excluding

This command does not insert new content, but rather makes existing content conditional.

If there is no selection, the conditionality will be applied to the currently active element. You can see the currently active element in the Tag Inspector:

If you hover over either of the "Make..." buttons, the element that will be converted to conditional will be highlighted.

If you select several inline elements, the conditionality will be applied to a common block-level parent of the selected elements.

Clear Conditions

This button does what the name suggests - clears conditions from elements. If there is no selection, the conditionality will be removed from the currently active element. If there is selection, the conditions will be removed from all of the selected elements. This feature removes only the conditions and not the content itself.

You can also clear conditions by clicking "unwrap" in the Tag Inspector or from the context menu:

Adding Conditions via the Source View

You can also add conditions to any HTML and ClickHelp-specific tags by adding an attribute in the source view. Here's an example:

HTML
<p ch:include="OnlineDoc,First">A paragraph</p>

You will need to add either ch:include or ch:exclude attributes. Multiple tags can be added, separated by a comma.

Common Scenarios

Here are a few of the frequently asked questions and answers to them.

How do I make conditional li/td/th/other element I can focus by simply clicking inside it?

If you have really simple content (no multiple paragraphs/images/other elements) inside these elements, you can simply put a cursor inside such an element and press Make Conditional.

How do I make conditional ul/ol/li/td/th/tr/table/other elements I can't focus by clicking inside it?

Click the corresponding tag in the Tag Inspector to select it and then press Make Conditional.

How do I make an image/video conditional?

Simply click to select it and then click Make Condit

How do I make several block elements conditional?

If they are <p> paragraphs, it's better to use Insert Including/Excluding. If it's something like li/tr, you can either select them all and click "Make Including/Excluding" or focus them one by one and click "Make Including/Excluding" each time.