Jump to content

value for a graphic field


ilona

Recommended Posts

What actual value(after selecting an image) does any graphic field have in MCC?

 

Here is what I'm trying to accomplish:

In my template(FP) I have a rule that looks at a graphic field's value, and then returns the name of that value as a string. For example, if the value is "<p>somepic.jpg</p>", the rule returns only the name part: "somepic".

Then another rule uses that name to display a resource. The return statement is this:

       new=somepic+'.pdf';
       return Resource(new);

 

The second rule simply displays a resource using the name of the jpg that is used for the first graphic field.

 

This works all great in FusionPro, but it doesn't work in MCC. Both graphic fields in MCC are using library images.

 

My first guess is that maybe the value in the first graphic field is not what I expect it to be. Is the value of any graphic field in MCC the "display name" that gets assigned in the library or the actual image("somepic.jpg" for example)?

 

Also, does MCC override FusionPro rules or does FP override MCC selections?

Link to comment
Share on other sites

I'm not exactly sure what you are trying to do from your description, however to answer one question, MC uses the actual name including the entire location string.

 

To create the resource:

var img_resource = CreateResource(Field("Image Library"), "graphic");

 

To get just the file name:

var img_name = GetFileName(Field("Image Library"));

Link to comment
Share on other sites

That's what I needed... As suspected MCC adds some additional info that gets returned as the field value. In my rule in FP, I replaced:

[color=#696969]var img= Field("Gfieldname");[/color]

with

[color=#696969]var img= GetFileName(Field("Gfieldname"));[/color]

and... it works like a charm... :D Thank you...Much appreciated!

 

I still have two questions:

1. Could you(or anybody else) give me an example of an actual graphic field value in MCC? For example, let's say I have a graphic field named XYZ, and I select a gallery image in MCC which is mypic.jpg for the XYZ field. When I click on the preview button in MCC, what does my field value in the XYZ field become? In other words, what value is getting passed to the GetFileName function?

2. As far as the overriding question: does MCC override FusionPro rules or does FP override MCC selections? Or is it all on a case-by-case basis?

Link to comment
Share on other sites

I still have two questions:

1. Could you(or anybody else) give me an example of an actual graphic field value in MCC? For example, let's say I have a graphic field named XYZ, and I select a gallery image in MCC which is mypic.jpg for the XYZ field. When I click on the preview button in MCC, what does my field value in the XYZ field become? In other words, what value is getting passed to the GetFileName function?

Well, it's a long UNC path with a file name, pointing to a graphic in an image library. Exactly what it is depends on the UNC path assigned to your library. Frankly, I'm not sure why you need to know exactly what it is. But if you really want to find out, you could just create a text rule to return the field value in your output, something like:

return Field("Gfieldname");

Again, though, I'm not sure what you would do with the information about the exact UNC path involved. FusionPro finds the graphics themselves for graphic frames, and the GetFileName function helps with rules that switch off of the file names, and that should be all you need 99 percent of the time.

2. As far as the overriding question: does MCC override FusionPro rules or does FP override MCC selections? Or is it all on a case-by-case basis?

I'm not sure I understand the question. There's no "override" occurring. Your rules are exactly the same. What's different is the input data. Specifically, when you're setting up your job in Acrobat with FusionPro Creator (Desktop), you're probably using a flat (delimited) text file with simple file names for graphics on your local machine, while MarcomCentral is generating a tagged markup file with <graphic> tags which contain the long UNC paths pointing to your uploaded image libraries. Even text fields can differ in the tagged markup file generated in MCC from text fields in your delimited file, as the tagged markup file can contains entities and tags; functions such as TaggedDataField can help to resolve this.

 

So the best answer I can give to your question is that everything could be different under MarcomCentral, because the format of the data is different, as well as the data itself.

Link to comment
Share on other sites

Well, it's a long UNC path with a file name, pointing to a graphic in an image library. Exactly what it is depends on the UNC path assigned to your library. Frankly, I'm not sure why you need to know exactly what it is. But if you really want to find out, you could just create a text rule to return the field value in your output, something like:

return Field("Gfieldname");

 

True, I could return the value, and then see what gets displayed in the preview in MCC.

 

Again, though, I'm not sure what you would do with the information about the exact UNC path involved. FusionPro finds the graphics themselves for graphic frames, and the GetFileName function helps with rules that switch off of the file names, and that should be all you need 99 percent of the time.

The GetFileName function really is all I should ever need. Why the need to know the details then? Pure curiosity...and just in case I ever find myself in the unfortunate 1%. ;)

 

I'm not sure I understand the question. There's no "override" occurring. Your rules are exactly the same. What's different is the input data. Specifically, when you're setting up your job in Acrobat with FusionPro Creator (Desktop), you're probably using a flat (delimited) text file with simple file names for graphics on your local machine, while MarcomCentral is generating a tagged markup file with <graphic> tags which contain the long UNC paths pointing to your uploaded image libraries. Even text fields can differ in the tagged markup file generated in MCC from text fields in your delimited file, as the tagged markup file can contains entities and tags; functions such as TaggedDataField can help to resolve this.

 

So the best answer I can give to your question is that everything could be different under MarcomCentral, because the format of the data is different, as well as the data itself.

 

I suppose my question here was related to the input data and UI Rules in MarcomCentral vs. resources and FusionPro(yes, Desktop) rules. For example, if I have a rule in FP that looks at a text field A, and if the value in A is "green", then it returns a resource green.jpg for some graphic field B. Then, I go ahead and create a UI rule in MCC that contradicts the FP rule, for example a "Cascading Drop-Down" where if A has a value of "green", then the graphic field B is "blue"(which would be some image blue.jpg). Who wins here? What will be displayed in the MCC preview for the customer?

Of course I could simply test this case, and see the results myself, but what I was looking for is more so a general answer where either MCC overpowers FP rules or vice versa no matter what the rule/case is....or does it simply depend on what evil contradicting rules I come up with(meaning case-by-case basis)? I suppose I already have the answer to that:

everything could be different under MarcomCentral, because the format of the data is different, as well as the data itself.

 

Thanks for answering my confusing questions...watch me be back with more. ;)

Edited by ilona
Link to comment
Share on other sites

I suppose my question here was related to the input data and UI Rules in MarcomCentral vs. resources and FusionPro(yes, Desktop) rules. For example, if I have a rule in FP that looks at a text field A, and if the value in A is "green", then it returns a resource green.jpg for some graphic field B. Then, I go ahead and create a UI rule in MCC that contradicts the FP rule, for example a "Cascading Drop-Down" where if A has a value of "green", then the graphic field B is "blue"(which would be some image blue.jpg). Who wins here? What will be displayed in the MCC preview for the customer?

Of course I could simply test this case, and see the results myself, but what I was looking for is more so a general answer where either MCC overpowers FP rules or vice versa no matter what the rule/case is....or does it simply depend on what evil contradicting rules I come up with(meaning case-by-case basis)? I suppose I already have an answer to that:

The rules you define in the FusionPro template are not modified by MarcomCentral (with a few exceptions), so they always get run at composition time. UI rules in MarcomCentral affect the tagged markup input data file that's generated and then fed to FusionPro. So the answer is that both rules have an effect, but the FusioPro rules are always run last, after the input file has been generated and it's being consumed for composition. So in that sense, the FusionPro rules "win" over the MCC UI rules.

 

In your example, the UI rule would set the graphic field in the data file to have a value of "blue.jpg" (with some really long UNC path). However, the FusionPro rule would still return "green.jpg". So what happens in the output depends on whether the graphic frame in your template is set to use the field value directly, or to use the value of the rule. If it's using the value in the rule (which it probably is, otherwise why would you have the rule?), then I would expect to still see green.jpg in the output.

Link to comment
Share on other sites

×
×
  • Create New...