Show / Hide Content
The Designer enables you to dynamically hide or show text, tables or images in a Form, according to a specific business logic, by inserting them in a Container.
After defining the Container you need to define the script logic of the Container (see Adding Scripts).
To define Container scripts:
- Prepare the logical groundwork for the script – design the conditions, tag values, and text/graphics that comprise the script.
- Select the Form element to place within the Container (e.g. text, table, image, etc).
- In the Data Repository pane, right-click the Container tag and click Insert Container; the Container properties window appears.
- Enter an appropriate container name and click New to define the script; the Script Editor window appears.
- Add a comment to describe the script.
- Define one or more script conditions.
- Define Hide / Show Container when the conditions are met.
- Define an alternative condition (if necessary) when the condition is not met.
- Define Hide / Show Container when the alternate conditions are met.
- Preview test the script.
Step 1: Preparing the Logical Groundwork for the Container Script
In this scenario, we are adding a short paragraph to the document. However, the paragraph is different for customers who made a big purchase (Grand Total >4000) or a small purchase (Grand Total <4000).
Step 2: Defining a Container Tag Script
We will start with defining the Container for large purchase paragraph: In the document, select the large purchase paragraph and then in the Data Repository panel, double-click the Container button
Step 3: Describing the Container Script
1. In the Script Editor Tree, under Statements, double-click Comment; the Edit Comment window appears.
Step 4: Defining the Condition for which the First Container Appears
1. In the Script Editor Tree, under Statements, double-click If; the Script Line Editor appears in the Line-If view.
Define the condition required for the container to function (see Adding Scripts), for example Grand Total> 1000, IsPrivate=TRUE or Cases=Null.
Step 5: Saving the Container Script
1. When you have completed the script, select a save option and click Save.
2. In the Container Properties window, click OK.
Step 6: Defining the Condition for which the Second Container Appears
Step 7: Preview / Test the Saved Script
After creating and saving the script, it is recommended to produce either a printed or a viewable preview of the document, to verify that the script produces the desired results.
You can use a container to disable output generators, using the Live Editor, from changing specific content in the Form during output generation.
To lock content:
- In the document, select the paragraph(s) you want to lock for editing and then in the Data Repository panel, double-click the Container button.
The Container Properties window appears (see above).
2. Enter a name and click New. The Script Editor window appears.
4. Click Save.
5. In the Container Properties window, click OK.
The content in the container will be locked for editing in the email Live Editor.