Conditional Sections (Part 1)

You can use the conditional section <<cs_ directive in a template to include or exclude a section of content. This is similar to using an "IF" statement.

If you use a conditional section within a numbered list, the numbering adjusts automatically.

This example in detail

This example uses a conditional section on its own, and also within a numbered list, and in a regular expression.

Conditional sections

These start with the <<cs_ condtional section directive and end with <<es_.

These are like IF statements. <<cs_sampleValue1>> is like saying:

IF sampleValue1= "true" THEN

display all text up to <<es_sampleValue1>>

The data contains "sampleValue1":"true" (JSON example).

If <<cs_ or <<es_ is on a line by itself the line is removed in the final document.

Used in a numbered list

The numbered list in the example has the second item surrounded by <<cs_ and <<es_.

The data contains: "sampleValue2":"false" (JSON example).

In the final document item 2 does not appear.

The numbering of the remaining items in the list adjusts automatically.

Used in a regular expression

The expression {sampleValue3=7} is evaluated.

If "true" then all following text up to the next <<es_ appears in the final document.

The data contains "sampleValue3":"7" (JSON example).

Feedback

Invalid Input

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam.

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam.

Invalid Input