2021.2

Table Of Contents
using the Conditional Content Script wizard" on page815, a CSS class will be applied
automatically.
If you have created the script yourself, or if you want a script to apply to more elements later on,
you have to do this manually.
1. Double-click the conditional script in the Scripts pane to reopen it.
2. Make sure that the selector is a CSS class (for example, .male) or an HTML element with
a certain CSS class (for example, p.male). See "Using the Text Script Wizard" on
page808 for further explanation on selectors.
3. Apply the same CSS class to all elements that should be shown or hidden under the
condition that you have set in the conditional script. Click each element and type the class
(without the preceding dot) in the Class field.
Showing or hiding a text selection
When you right-click on an element and make it conditional, the element as a whole will be
made conditional. This happens even when you select a few words in a paragraph and right-
click those words; the paragraph as a whole will be made conditional.
It is, however, possible to show or hide a part of a paragraph.
If the text that you want to show or hide is short, you could use the Selector and Text option in
the Conditional Content wizard and copy the text into the Text field. This option uses the
specified selector as a trigger for the script. The script applies to all instances of the text found
within the specified selector.
Searching for text can be a lengthy operation, compared to searching for an element with an ID.
If performance is an issue, of if the search text is long, a better alternative is to wrap the text in a
span element first.
1. Select the part of the text that you want to make conditional.
2. Right-click the selected text and click Wrap in span.
3. Type an ID and/or a class. An ID is fine if this is the only thing that should be shown or
hidden on a given condition. Use a class if there is more that should be shown or hidden
on the same condition.
4. Start creating a conditional content script from the Scripts pane. Use the ID or class as
the selector of the script. See "Showing or hiding elements using the Conditional Content
Script wizard" on page815.
Page 819