Natea11 Posted May 21, 2013 Share Posted May 21, 2013 I've got a client that is putting together an order form and was wondering if there is a way to right a rule to the effect of something like this. If fields "Name", "Address", "Phone# and "Recipient#" are empty return graphic "Contact". Basically, if all those fields are empty they want to place a graphic in the same space that has lines so that someone can hand write in. Thoughts?FAI_FH12GiftList.zip Quote Link to comment Share on other sites More sharing options...
step Posted May 21, 2013 Share Posted May 21, 2013 You could achieve this using an inline graphic: var contact = [Field("Name"),Field("Address"),Field("Phone#"),Field("Recipient#")]; return (contact.filter(String) != "") ? contact.filter(String).join("<br>") : '<graphic file="Contact.pdf">'; Quote Link to comment Share on other sites More sharing options...
Natea11 Posted May 22, 2013 Author Share Posted May 22, 2013 Thnks. I'll give it a try. Quote Link to comment Share on other sites More sharing options...
digitalsig-1.com Posted September 4, 2013 Share Posted September 4, 2013 I'm doing something similar; how does this script tell FusionPro the location of the graphic image? Quote Link to comment Share on other sites More sharing options...
esmith Posted September 4, 2013 Share Posted September 4, 2013 I'm doing something similar; how does this script tell FusionPro the location of the graphic image? step's code assumes the image is in the same folder as the template. If your graphic is elsewhere, you would need to include the path in the quoted portion of the graphic tag which should either be a full path or relative to the template. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted September 4, 2013 Share Posted September 4, 2013 step's code assumes the image is in the same folder as the template. If your graphic is elsewhere, you would need to include the path in the quoted portion of the graphic tag which should either be a full path or relative to the template. Hard-coding the path into the JavaScript rule makes the job less portable. It's better to the put path in the Search Path box on the Advanced tab of the Composition Settings dialog; that can be overridden in the CFG file as needed for Producer API compositions (such as in MarcomCentral). Or, you can use a named resource, added via the Resources dialog, and then call it out in the rule, like so: var contact = [Field("Name"),Field("Address"),Field("Phone#"),Field("Recipient#")].filter(String); return contact.length ? contact.join("<br>") : Resource("Contact").content;Then the path to the resource is specified in the Resources dialog, and can be re-linked there if necessary. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.