Conditional Content script dialog

Conditional Content scripts can show or hide elements depending on certain conditions and values. They can be added by right-clicking any element in a template and clicking Make Conditional. If the current element has neither an ID nor a class, an ID will be automatically generated. See Showing content conditionally.

The general options in the Conditional Script wizard are:

  • Name: The name of the script, making it easier to identify it.

  • Selector: The Selector or Text to apply the result of the script to.

    • Selector: Uses CSS selectors to find the element to which the script applies.

    • Text: Uses text as a trigger for the script. The script applies to all instances of the text found in the template.

    • Selector and Text: Uses the specified selector as a trigger for the script. The script applies to all instances of the text found within the specified Selector.

    For more information about Selectors see Selectors in OL Connect.

  • Action: Use the drop-down to select whether to Show or Hide the element when the condition below is true. If, conversely, the condition evaluates to false, the opposite action will be performed.

A condition is made up of groups and rules.

The Add button adds a rule that evaluates a data field to a group.
To add either a group, or a rule that evaluates a runtime parameter, click the downward pointing arrow next to this button and select Group or Parameter Rule.

  • Group:

    A group consists of one or more rules with a logic operator. Four logic choices are available at the Group level. These are:

    • All of the following.
      This equates to the logical operator (... AND ...).
      If all of the associated criteria are met, then this group resolves to TRUE.

    • Any of the following.
      This equates to the logical operator (... OR ...).
      If any of the associated criteria are met, then this group resolves to TRUE.

    • Not all of the following.
      This equates to the logical operator (NOT(... AND ...)).
      If any (but not all) of the associated criteria are met, then this group resolves to TRUE.

    • Not any of the following.
      This equates to the logical operator (NOT (... OR ...)).
      If none of the associated criteria are met, then this group resolves to TRUE.

  • Rule:

    • Data Field: Use the drop-down to select upon which data field in the record the condition will be based.

    • Operator: Select which kind of comparison is applied. The options are: Equal to, Not equal to, Contains, Does not contain, Begins with, Ends with.

    • Value: The value(s) used for the conditional check. Values are case sensitive by default. You can click the button next to the value to make them case insensitive, which means that upper- and lowercase letters are treated as being the same.

The script is displayed below the condition and updated while the condition is being edited.