XMPie uDirect Conditional Formatting

ChrisWorks

Active member
I'm trying to achieve something with uDirect that I think should be possible but I'm not sure how it should be done.

I have a client that has a basic excel spreadsheet with about 30 names. Some of the people in the list of cell phones while others dont. Some of them have middle names while others don't. The problem is that when I go to set up my merge document in InDesign. Say for instance I set up a line with First Name, Middle Name, Last Name. When someone has all 3 of these it's fine. But when someone only wants to use First Name, Last Name what ends up happening is I get 2 spaces in between the First Name & Last Name because there has to be a space there to separate the First Name from the Middle Name even though there's not a Middle Name present. Does anyone know of a way to use the qLingo in XMPie to dynamically add or subtract this space depending on whether a Middle Name is present?

I've thought of just adding the spaces before the Middle Name, Last Name fields in the spreadsheet so that I don't actually have to use spaces in the InDesign file. This would work for this issue, but I have some other reasons I want to use conditional formatting and I cannot get it to work.

The other thing I'm trying to do with conditional formatting is when someone has 2 Titles or more for their job. The client wants to use 2 lines of space if the person has 2 titles. So 1 title on each line of type. I'm trying to vertically center the text within a box but what happens is that when I vertically center 2 lines of text but the person doesn't have a 2nd title, there just ends up being a blank line and it doesn't look centered. So I'm hoping that I can dynamically insert a return when that 2nd line is present as needed.

Anyway, hoping someone on here might know something about how this can be done as I cannot really find anything answering this anywhere else online.
 
Just an update.

I have found how to get the spacing to work how I wanted it to. Here's the link to the site where I found it. It provides some good examples of conditional functions for uDirect.

XMPie Overview
I used the instructions in the first example.

But I'm still trying to figure out how to get it to add a return to a line automatically when a field is present. I imagine it's something similar to the spacing issue. I'll update when I find that.
 
For anyone following this topic, I have found a way to get this to work.

In XMPie uDirect when you are creating conditional formatting for a field you can check the "extended functions" box to get many more functions to use other than the default few that are available. In the extended functions there is a command called "forced line break" which I used within my if/else statement to get the desired effect.

I've attached a screenshot of the if/else statement to make it happen. This will look to see if the Title 2 field has anything in it. If it does it will insert a forced line break and then add the Title 2. If there isn't anything in the Title 2 field it will do nothing.
Screenshot on IMGUR
 
Hi,

I'm new to this forum so I hope my post is in the correct group. We are currently using InDesign CS3 and Xmpie uDirect v4.0.3 on a PC running Windows 7.

Can you help me create a rule which will print a Graphic content object based on a specific value? I want to display the Graphic when the value is 1 and do not display any graphic when value is 0.

Thanks in advance for any assistance you may offer.

-Greg
 
Hi,

I'm new to this forum so I hope my post is in the correct group. We are currently using InDesign CS3 and Xmpie uDirect v4.0.3 on a PC running Windows 7.

Can you help me create a rule which will print a Graphic content object based on a specific value? I want to display the Graphic when the value is 1 and do not display any graphic when value is 0.

Thanks in advance for any assistance you may offer.

-Greg

You need to create a visiblility rule that is if/than. target the input that will have the 0 or 1 in it, and basically if 1 show "graphic", else show nothing.
 
Wow, thanks for your prompt response! I have had some success with what you suggested. However, I need to place multiple Graphic content objects next to each other on one line. I was hoping this would work similar to dynamic text.

However, the Graphic content objects that is equal to 0 displays a blank space about the same size of a Graphic content object that equal 1. Is there anyway to remove or eliminate this blank space from the line?

-Greg
 
I guess Im not following. What is the data that you are linking to? is it the same graphic over and over or what is the desired end result?
 
My apologies as it may be easier to show you rather than explain. Please find attached a Sample.jpg file showing Current Results (what happens now) and Finish Results (what I want to see). Sample.jpgLet me know if this helps clarify what I am trying to accomplish.

-Greg
 
My apologies as it may be easier to show you rather than explain. Please find attached a Sample.jpg file showing Current Results (what happens now) and Finish Results (what I want to see). View attachment 3627Let me know if this helps clarify what I am trying to accomplish.

-Greg

the best way that I can see to do this will be a bit of a mess of QLingo, but possible.
you have graphics A, B, C (we'll stop there for now)

here is what you're going to want to do for each graphic box, now this is assuming that you ALWAYS want them to go in the same order, and that graphic A will never be in the second box, etc. (this is not proper QLingo format, if you need that, you will have to wait a bit for me to get down to that Comp, to figure it out.

Graphic Box one:
If FieldA = 1 (place A.tif)
else (If FieldB = 1 (place B.tif)
-> else (If FieldC = 1 (place C.tif)
--> else (Place Blank.tif)))

Graphic Box two:
If FieldB = 1 (place B.tif)
else (If FieldC = 1 (place C.tif)
-> else (Place Blank.tif))

Graphic Box Three:
If FieldC = 1 (place C.tif)
-> else (Place Blank.tif)


It's not super elegant, but it will get the job done. Once you create the stacked If/else statements for the first one, just strip off the outer set for each successive box. Hopefully that makes sense.

--> these MUST be nested like this, not just if/else if. nested like this, it will either place the first graphic and ignore the rest of the script, or fail and move to the next statement. if you do not nest them, the script could behave unpredictably if more than one statement is true.
 
Last edited:
Hi,

Thanks for your reply. I don't think the order is important. However I tried to incorporate this logic and noticed, if Field A = 0 and Field B = 1 I get Placeb.jpg twice. In position 1 and 2. This seems to happen every time the data contains 0.

FYI, I have a total of 15 graphic objects which need to be placed and the combination of 0 and 1 are numerous.

-Greg
 
hrmm....didn't think that one through all the way.
so.....how to compare what has gone before and then grab the correct graphic...oh what a mess... ;)
is this a big rush, or can I think about this for a few hours?
 
Hi,

Yes, I didn't expect an answer over night. I have until the end of the week to come up with a solution. I've got an alternate plan which does not use XMPie for the merging. However, it requires a script and changes to the input data.

Currently, I have placed a support call to Xerox and sent out inquires to other XMPie forums with hopes of hearing a solution soon.

Thanks, I truly appreciate your prompt replies thus far! :)

-Greg
 
questions...

Can you, instead of returning 1/0, can you return logo1=fish logo2=egg, etc.?
otherwise, it IS possible with QLingo, it's just going to be a VERY long script. but I have an idea...
 
if you can get your client to change it to names, then it's pretty easy, just name the graphics the same, and have them call as variable image.
so product one would have milk, eggs, fish and would place the appropriate graphic in slot 1, 2, and 3.
product two would have fish, peanuts, wheat and would place them appropriately. That would be, by FAR the easiest.

but I'm still rattling around ways to figure out with if statements. my current thought is using an "i" variable and counting how many before...but I'm not sure that would work either.
 
For your first option, what do you mean by "call as variable image"? The only options I see (for Type:) are {Text, Text with Style, Text File, Graphic, Visibility, Style and Table}. FYI, Table is not available for selection (Greyed out)...
 
example of spreadsheet for easiest way... see attached screen shot.

Then, just use a qlingo script to compare if the field is empty or filled, if filled tack a .tif or .eps on the end to call the file name. If empty, put the blank.tif file in so you don't have those ugly "missing" file boxes.
 

Attachments

  • Screen shot 2013-08-26 at 2.32.50 PM.png
    Screen shot 2013-08-26 at 2.32.50 PM.png
    17.4 KB · Views: 290
Ok. I've tested the variable image method and this is quite close to what I want. However, I still get blank boxes in places the data is empty. Please see attached Sample2.jpg.
 

PressWise

A 30-day Fix for Managed Chaos

As any print professional knows, printing can be managed chaos. Software that solves multiple problems and provides measurable and monetizable value has a direct impact on the bottom-line.

“We reduced order entry costs by about 40%.” Significant savings in a shop that turns about 500 jobs a month.


Learn how…….

   
Back
Top