strido Posted August 9, 2016 Share Posted August 9, 2016 (edited) I have a business card with three possible variables. 1) Two phone numbers, a Fax and an Email 2) One of each 3) One Phone, one Email. The customer is using graphics to indicate which is which. I have all three graphics in .EPS files. In order to make it only one template, I'd like to have a rule that says "return graphic + field." This way I can just highlight the whole paragraph and suppress if empty to prevent any empty fields from displaying their associated graphic. if (Field("Phone1") == "") return "" else return Resource("Phone") + (Field("Phone1"));I'm trying to get one down before I do the others. This rule doesn't return the resource, nor will it if I change "Return Resource("Phone") to Return Rule ("Phone1") ** I should note that in either case what actually gets returned are the actual words Resource("Phone") as well as the values in the field. Edited August 9, 2016 by strido Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted August 9, 2016 Share Posted August 9, 2016 It's not clear to me where the graphic fits in, but there are a couple things you could do. You could use a repeatable component. But an inline graphic is probably easier, and if you're also using the "Suppress if containing empty variables" setting, then you don't really need a rule for the text field at all. You only need a text rule to return your inline graphic, something like this: return '<graphic resource="Phone" height=3600>'; Where you can specify either the height or width (or both) in hundredths of points. Quote Link to comment Share on other sites More sharing options...
step Posted August 9, 2016 Share Posted August 9, 2016 Try this: if (Field("Phone1") == "") return "" else return Resource("Phone")[color="Red"].content[/color] + (Field("Phone1")); Quote Link to comment Share on other sites More sharing options...
strido Posted August 9, 2016 Author Share Posted August 9, 2016 That'll do! Thanks .content... that's the only change. Man do I need JS training or what? 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.