You are here: Doc-To-Help Markup Language (D2HML) > Hot Spot Types > Conditional Text Hot Spot

Conditional Text Hot Spot

The Conditional Text hot spot specifies the hot spot text to be used in various platforms and help targets. For example, you can use a conditional text hot spot to make your text appear in online help only. Or you may want certain text to only appear in a help target you have named MyHelpTarget.

The Behavior property of this hot spot type is set to Conditional Text. The following predefined styles have this Behavior, and the corresponding HTML tag or Word Style can be used when formatting without the D2HML Styles toolbar:

D2HML Style

Corresponding HTML Tag

Corresponding Word Style

C1H Online (Hidden=False)

<span class="C1HOnline"></span>

C1H Online

C1H Manual (Hidden=False)

<span class="C1HManual"></span>

C1H Manual

C1H Passthrough HTML (Hidden=False)

N/A

C1H Passthrough HTML

C1H Conditional (Hidden=False)

<span class="C1HConditional"></span>

C1H Conditional

Note: All styles that have a non-empty Style.Condition property have the Conditional Text behavior.

 

The following properties are supported by this hot spot type:

Supported Properties:

Attribute

This is the list of attribute pairs in Name:Value format that must be defined in the help target to include this text in the target. The characteristics of this property are:

•      Primary

•      Collection

•      Case-insensitive

Platform

This is the list of help platforms in which the conditional text is included. The characteristics of this property are:

•      Primary

•      Default

•      Collection

•      Case-insensitive

The possible values of this property are:

•      Manual

•      Online

•      HTMLAny

•      HTML

•      HTMLHelp

•      MSHelp

•      JavaHelp

•      WinHelp

Target

This is the list of names of the help targets in which the conditional text is included in the target. The characteristics of this property are:

•      Primary

•      Collection

•      Case-insensitive

Passthrough

This property is supported in Word source documents only. If set to True, this property defines the text as passthrough HTML for HTML-based targets. The characteristics of this property are:

•      Secondary

•      Case-insensitive

All styles above, except C1H Conditional, have a non-empty Style.Condition property value. This means that the user can apply these styles to the text without entering any conditions. The C1H Conditional style is used in cases where the user needs to define a condition explicitly in each hot spot. A condition must be specified when the C1H Conditional style is used in order for the hot spot to work correctly.

Conditional text is not removed from a target if the value of one of the primary properties defines a condition satisfied for the current help target. This condition can be specified locally in each conditional text hot spot using one of the primary properties, but that is only needed in advanced cases. Usually, the condition is associated with the style itself, so the user does not need to specify the condition in each hot spot.

To associate the condition with a style, use the Style.Condition property. This string property has the same value format as the secondary part of a conditional text hot spot. If the style has a non-empty Condition property and the hot spot has secondary part, the primary properties in the hot spot’s secondary part have higher priority. For example, if the hot spot sets Platform=WinHelp, and Style.Condition = Platform=Online, then the effective platform will be WinHelp.

All primary properties are collections, so the user can specify more than one value. The condition is satisfied (so the conditional text is not removed) if it is satisfied for at least one value. For example, with condition Platform=HTMLHelp+WinHelp the conditional text will appear in WinHelp and HTMLHelp target.

To create a Conditional Text hot spot, select the link text and secondary part, if it exists, and press either Online Text , Manual Text , or Conditional Text  on the D2HML Styles toolbar. Dialog boxes are not necessary when using the Online Text and Manual Text buttons. Clicking the Conditional Text button opens the Condition window, where you can specify your conditions.

Condition Window

Conditional text may consist of more than one paragraph with style formatting. Microsoft Word does not allow you to apply style formatting within conditional text because it is already formatted with the C1H Conditional style. By default, Doc-To-Help applies conditional text as a comment rather than a D2HML style in your Word documents so that style formatting may be used within the comment. For more information, see Specifying Conditional Text.

If you are not using the toolbar, place the link text and secondary part in the corresponding HTML <Span> tag to format it with the D2HML style.

The following table gives you some examples of using the Conditional Text hot spot:

Hot Spot in Word and HTML Editor

HTML Code

Description

Online text

<span class="C1HOnline">Online text</span>

The text formatted with this style is removed from Manual targets only.

Manual text

<span class="C1HManual">Manual text</span>

The text formatted with this style is displayed in Manual targets only.

Conditional text|platform=winhelp

<span class="C1HConditional">Conditional text|platform=winhelp</span>

The text Conditional text is displayed in WinHelp targets only.

Conditional text|=winhelp

<span class="C1HConditional">Conditional text|=winhelp</span>

The text Conditional text is displayed only in WinHelp targets only.

Conditional text|attribute=build:release

<span class="C1HConditional">Conditional text|attribute=build:release</span>

The text Conditional text is displayed only in targets that have the attribute value Build set to Release. Please note, the separator bar ( | ) and everything to the right of it is always removed from the target.

Conditional text|target=my html help;passthrough=true

<span class="C1HConditional">Conditional text|target=my html help;passthrough=true</span>

The text Conditional text is displayed in the target with the name “My HTML Help”, and it is passthrough HTML.