Using Conditional Layouts
CardExchange® Producer & CardExchange® Visitor offer the possibility to select a different layout based on the contents of a database column through expressions.
The layout condition is available for the Professional and Ultimate editions of CardExchange® Producer, and the Business edition of CardExchange® Visitor.
You should first create two different layouts within the Designer, you can add a second layout to a template by clicking on the “Layout” button under the insert tab as below:
Now you have a second layout that you can design, this can be based on the first layout or completely
different.
Now you need to configure the layout condition, this can be specified in the Eexpressions tab of the page-setup window.
Layout condition
When a card template consists of multiple layouts, the layout-condition property can be used to determine whether a layout applies or not.
Now select the first layout from the pages tab of the explorer window, right click on it and choose page setup.
Imagine, for example, that the template has two layouts and that we type
layout == 'A'
for the layout condition of the first layout. When pressing the Enter key or Tab key or clicking OK, it will detect that a new variable called 'layout' was introduced and prompt for a default value. You could set the default value to 'A', as shown in the screen shot below.
Now close the page-setup window, select the second layout and open the page-setup window again. Type in the Expressions tab the layout condition
layout == 'B'
You will not be prompted for a default value anymore, because the variable 'layout' is already part of the variables collection.
Now when you look under the data tab of the explorer menu, you will see a sub tab for variables which contains a variable called layout. You can select this and from the properties window you can then map it to the field in the database that contains the layout condition.
The first layout will be shown for records that have the value 'A' in that field, while the second layout will only show if that field contains 'B'.
Layout conditions can be controlled by expressions that are much more complex than this. The expressions can contain functions and they can use multiple variables. It is possible to define the layout conditions in such a way, that for some records multiple layouts apply and for others no layout at all. Multiple cards will be printed for the same record if multiple layouts apply. If no layouts apply, the record will be skipped when executing a print batch.