The default image is a red circle with an X in the center. The customer would like none or an image of their choice. Currently this is html being created within the script manager with a new image tag, based on csv data.
I am hoping for a Connect solution / answer, as I would prefer not to script this in Workflow.
Default.jpg will appear whenever the main image is unavailable. You will have to add this for every images. At design you still see the X but at run time, the default image will show. Of course, make sure that the default image is available. Having it as part of your resources would be the most logical way.
I am not sure if itās because I only have a print context or if itās that, plus the html for the img tag is being built dynamically in the script pane.
Make sure to check the syntax since you are building it dynamically. HTML has a way of doing nothing when syntax is wrongā¦double-check single-quote VS double-quote and so onā¦
Unfortunatly, while going further into your request an actual limitation was found. It will be bypass in the future. Sadly I do not have a workaround as of now nor do I have an ETA to provide.
In print context and control script, You can use Resource() function to check if current image in this path exists.
Otherwise create dummy.png image which will be small, white rectangle and replace it. (Place inside images folder)
var checkSignaturePath, results;
// path to signature
checkSignaturePath = record.fields.ChkSigFile;
// check if signature exists using resource() function
// if not then null will be returned
var resInfo = resource(checkSignaturePath);
// if our resInfo is not null
if (resInfo != null)
{
// render our signature
results.attr(āsrcā, āfile:///ā + checkSignaturePath);
}
else
{
// if null has been returned then render fake dummy image
// image needs to be inside Resources/Images/ folder
results.attr(āsrcā, āimages/missing.pngā);
}