In certain cases, instead of requiring that the customer manually enter data into each block of a product, you can pre-load the blocks with data stored in a database.
When the Design Online process begins, the customer customer is shown a dropdown containing all the records from a single field in the database. The customer selects the record he wants from the dropdown. When the Designer application loads, the blocks will be filled with data for that record from the database.
The steps required to prepare a database lookup are as follows:
The database should contain as many fields as there are blocks in the template file. In addition, the database should contain 1 additional field, the "Key" field, which will contain the data for the dropdown field from which the customer selects a specific record. Data in the Key field is not inserted into the final document.
For text blocks, the database should contain the data that will be inserted into the block. For text blocks with type Textflow, the tag <nextline> can be inserted where you would like to insert a linefeed.
For image blocks, all images must first be uploaded to image galleries. In the database, you should insert the ID number of the image in the gallery.
Prior to upload, the database must be saved in the sqlite format. There are a number of commercial and open-source tools that can convert databases from CSV or Excel format to the sqlite format:
Name | License | OS X | Windows |
SQLite Database Browser | Open-source | Yes | Yes |
Razor SQL | Commercial | Yes | Yes |
SQLite Data Wizard | Commercial | No | Yes |
Once the database has been converted to sqlite format, it must be uploaded to the Designer server.
To upload your sqlite data, click the link "Add database lookup" after you've created the product and uploaded the appropriate template.
After the database is uploaded, you will be asked to create the mapping between the fields in the database and the blocks in the template file. In addition, you will be asked to indicate which field in the database is the "Key" field. The "Key" field is displayed to the customer in a dropdown field and allows the customer to indicate the record from the database that will be used as default data for each block in the Designer WYSIWYG interface:
You can also configure 2 text fields that are displayed to the customer in the customer interface:
For product with a database lookup enabled, there are 2 steps in the design online process: