Jump to content

A Way to Call Out to Specific Image Libraries?


dhealy72

Recommended Posts

I have a situation where I am using the workaround for Image Profile Attributes to pull in headshot images with SSO. My dilemma is this... In many of the templates we'll be setting up for our client, the user has the option of their piece being in Black & White or Color, hence the headshot image would need to change based on this selection. I am wanting to know if it's possible to assign a rule in the FusionPro template that would call out to a particular image library in MarcomCentral whether BW or Color is selected. So, there would be an image library for the Color Images and an image library for the Black & White Images, but the file names would be identical. This way the image could be pulled in based on the user's Image Profile Attribute, which uses a Text Profile Attribute Field. Make sense?
Link to comment
Share on other sites

dhealy,

No you cannot reference a library to tell the Rule where to pull images from. It is important to know if you are using MarcomCentral (MCC) Manager or MCC Admin, as Image Profile Attributes have been phased out of MCC Admin. You mentioned using Text Profile Attribute (TPA):

“This way the image could be pulled in based on the user's Image Profile Attribute, which uses a Text Profile Attribute Field. Make sense?”

So this leads me to think you are using MCC Admin.

 

Here is an example of how you can do it; however, it is not pointing to different Libraries as you inquired about... you will need to rename your images. First, establish our image names: “FrankRizzo.jpg” is the color version and “BW-FrankRizzo.jpg” is the black and white version. You will need 2 fields to manage this, 1) “Image Format” which is a choice for the User: Color or BW; 2) “Headshot” is the TPA field containing ONLY the color file name. The text rule referencing the TPA field should contain the following:

if (Field("Image Format") == "Color")
   return CreateResource(Field("Headshot"), "graphic", true);

else if (Field("Image Format") == "BW")
   return CreateResource("BW-"+Field("Headshot"), "graphic", true);

else return NullResource();

 

Of course you will need to make sure each color and BW image are associated to the template on the Images tab, but that should do the trick.

Link to comment
Share on other sites

×
×
  • Create New...