Conditional text removal

13/08/2008

Some parts of text may need to appear only if other parts are present. E.g. Ph. shows only if there is a phone number, Fax only if there is a fax number.

A sample CDR file can be downloaded from your Sample Stationery catalog (go to Summary page).

Example

Sometimes phone numbers contain an extension number.

Phone {(456)-123 4567} Ext. {7890}

A line that contains two input fields (Phone and Extension) should only show the fields that the user inputs data for.

This is achieved by puting the optional text parts inside [square brackets]

Phone {(456)-123 4567} [Ext. {7890}]

If the user doesn’t input the extension number, the content between the [squared brackets] dissapears and the rest of the fields shift according to the horizontal alignement.

Web-to-print software processing

web-to-print, text, conditional removal, optional

When the user inputs data in all the fields, all parts of the line are visible.

/

web-to-print, text, conditional removal, optionalWhen the user doesn’t input data in Ext. Number field, the number along with the Ext. prefix dissapear from the template. The rest of the text shifts right because the paragraph is right-aligned.

Nested sections

Take for example a line at the bottom of a personal letterhead. Assume it always has the office address, but the phone number is optional.

73 Main Av, Bay Area, CA 34433 [Ph. [({456})]{723-93-03}]

Fields: Area;Phone number

( )- part for the area code will appear only if there is an area code.

Ph.and the rest of the line will be removed if neither area code nor the phone number are entered because they are enclosed in [square brackets].

There is no set limit on how many nesting levels you may have, but it won’t be practical to do more than 3.

See also: