Jump to content

Combining Graphic rules and Text rules


strido

Recommended Posts

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 by strido
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...