Jump to content

A way to call out "white" within a rule?


BAndreas

Recommended Posts

I have a business card template where a user can select a black or white background, and the copy is returned in the opposite.

Here is the code I used. It validates and works correctly on the desktop, but not when uploaded. (White appears dark grey on top of Black) The white is also within my template color manager. :confused:

 

var modTextBlack = "<f name=\"" + Field("Font") + "\">" + "<color name=\"black" + "\">" + Field("Fname") + "</color>" + "</f>";

 

var modTextWhite = "<f name=\"" + Field("Font") + "\">" + "<color name=\"white" + "\">" + Field("Fname") + "</color>" + "</f>";

 

if (Field("Color") == "black")

return modTextWhite;

else

return modTextBlack;

 

Appreciate the help on this.

Link to comment
Share on other sites

Hi esmith. Trying to expand on the code you provided in a past thread. (Mucho thanks!) Unfortunately, I get the same result with the capitalization. (Dark gray type on a Black background.) Anyway, works great on the desktop. :p
Link to comment
Share on other sites

Color names in FusionPro (in tagged markup) are not case-sensitive. That is, "Black" is the same as "black" and "BLACK." However, if you write some JavaScript logic which does a comparison against a color name (such as in your example), then that comparison may very well be case-sensitive. So you may want to do something like this instead:

if (ToLower(Field("Color")) == "black")

Beyond that, if your output is different in Desktop than in MarcomCentral, I would suggest asking about it on the MarcomCentral forum.

Link to comment
Share on other sites

Like I said, if it's working differently under MarcomCentral, you should ask on that forum. You may also want to try making a copy of the rule with the "Treat returned strings as tagged text" box UNchecked and output that to a separate frame as a means of debugging after uploading. Maybe dump the field value as well; it might not be what you think it is based on the entry in the web form.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...