Personal tools
You are here: Home Products AT Data Merge Documentation How To AT Data Merge 0.1 Integration
Document Actions

AT Data Merge 0.1 Integration

This How-to applies to: 0.1
This How-to is intended for: Developer

Developer instructions for integrating AT Data Merge into their content types and applications.

To data merge enable a content type, some textual AT fields or widgets must use DataMergeStringField (or DataMergeTextField), or DataMergeStringWidget (or DataMergeTextWidget). These are drop-in replacements for StringField & TextField & the corresponding widgets. There are subtle differences in the outcome depending on whether one uses the data merge fields or the corresponding widgets; it is a good idea to start with the fields.

The fields have two special properties: "data_method" and "separators". The data method should be set to the name of the data getter method (implemented by your content type) that is used to retrieve the data that is used in the data merge operation. The default name is "compileMergeData". The return value should be a dictionary containing {fieldname:replacement_value} key-value pairs that should both be strings.

The separators property is a two-character string (left & right separator) giving the characters that are used to identify field names among the "normal" content. By default the value is "[]".

The simplest way is to add a DataMergeStringField or a DataMergeTextField to your content type and implement the data method. Then, edit the field content & include [fieldname] in the field content. When viewing the content, the replacement value is shown, rather than '[fieldname]'. Obviously, the data getter must return a value for "fieldname", for whatever field name is used.

If you're interested in more usage examples of how ATDataMerge has been used, check out the eCampaigning Tool product.

by FairSay last modified January 30, 2007 - 12:18

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by