Inline Conditions

Top Previous Topic Next Topic  Print this topic

An Inline Condition is an inline element that is displayed only if a certain condition (derived from the input data) is met. In other words, the element is only rendered if the expression evaluates to a true value. It is the inline equivalent to the Conditional Section.

Example:

A collection of CDs is considered as input XML file.

For example, sections that fulfill a certain condition (for example title and artist of the albums having prices over 10$ or having a certain year of appearance) can display a certain text.

In order to do that the user needs create a Repeating Section in order to test the condition for each CD.

 

1. To insert a Repeating Section, the user must access the Repeating Section button located in the Dynamic Content group under the Insert tab.

 

2. The Edit Expression dialog will be displayed. The path to the referenced node must be chosen (in this example cd) and the OK button selected.

 

inline_conditions1

 

3. Using the Inline Condition button located in the Dynamic Content group under the Insert tab must be selected in order to insert an Inline Conditions into the Repeating Section.

 

4. The Edit Expression dialog will be displayed again. The section's condition must be selected (for example price>10) and then the OK button selected.

For this example, an asterisk will be added for items with a price higher than $10.

 

inline_conditions2

 

There are two editable sections: the first one will display a customized content if the condition is met and the second one (the fallback section)will show a customized content if the condition is false.

 

If an asterisk is written in the first section and nothing in the fallback, the following result will be displayed in the output document:

 

inline_conditions3