You can do this in a template, but you will need three fields in the template setup as images, some images in an Image Picker group, and a small amount of VBScript applied to a field. The images and PDF file referenced below are included in the ExamplePickerUpload.zip
- 1) Provide a PDF file with three fields, and add images to an Image Picker Group by editing the assets for the template.
Picture 1 shows the assets for the template with the PDF file loaded, and some basic colored circle images available in an image picker.
- 2) The first two fields, fielda and fieldb, must be set to be image fields getting their data from user entry. The third field, fieldc, will get getting its data from field scripting.
Picture 2 shows the Field Type settings for all three fields, and where the input will come from.
- 3a) The field to show the images from the Image Picker must be set to use the picker group under User Control Type.
Picture 3a shows the Data Capture settings for fielda.
- 3b) The field for the upload is set as Advanced Image Upload. Note that the setting for "Allow upload from asset" is enabled. So this field will accept input from an image upload, or from a site asset if they are available
Picture 3b shows the Data Capture settings for fieldb.
- 4) Fields fielda and fieldb are set as hidden as the values for these fields will not be displayed directly on the template. The input controls for them will still be visible.
Picture 4 shows fielda and fieldb set as hidden on the Format tab, so these fields will not shown on either proof or production output. Since these are hidden fields, their position on the template does not matter.
- 5) The script that tells the template to choose one field or another is assigned to the Field Scripting tab in fieldc. Script is: ifs(fieldb="",fielda,fieldb)
Picture 5 shows the script assigned to fieldc in the Field Scripting tab.
Fieldc is being instructed to check the value for fieldb. If fieldb is empty, it will return the value from fielda, which has the image picker group. If there is a value for fieldb as an upload image, it will use the uploaded image.
Since is is scripted this way, it gives the upload preference over the image picker. If the template is being used for a site order, then either the image upload or the site asset chosen will be given preference over the image picker.
The site asset options will only be visible when ordering a product that uses this template from a Pressero site where site assets have been setup. The site asset values will not be visible when logged into the eDocBuilder administration and setup windows.
If you are interested in having site assets as a choice to a user, please see the following article.How to allow site users to manage assets in Pressero for use with eDocBuilder Orders