draco66 Posted October 12, 2016 Share Posted October 12, 2016 Asking for help twice in two days. Sorry about that. I have searched for this and nothing seems to fit what I am looking for. Sounds simple but I can't figure out how to do it. I have a data field that will contain a color. In my text frame I want the color of the text to match what the color in the data field is. So if the color in the data is "Blue" then all the text that prints in that text box in my template should be Blue. Quote Link to comment Share on other sites More sharing options...
step Posted October 12, 2016 Share Posted October 12, 2016 You just need a rule that returns the color tag at the beginning of your text box. The following rule will return the color tag if the color in the "Color" field is a defined FusionPro color: var color = Field("Color"); return FusionPro.Colors[ToLower(color)] ? '<color name="' + color + '">' : ''; Quote Link to comment Share on other sites More sharing options...
draco66 Posted October 12, 2016 Author Share Posted October 12, 2016 The rule validates with the correct color tag but all the text still comes out black when composed. Quote Link to comment Share on other sites More sharing options...
step Posted October 12, 2016 Share Posted October 12, 2016 Are you using multiple paragraphs? You can try this: var color = Field("Color"); return FusionPro.Colors[ToLower(color)] ? '<span color="' + color + '">' : ''; Quote Link to comment Share on other sites More sharing options...
draco66 Posted October 12, 2016 Author Share Posted October 12, 2016 Does not work. So I created a rule with the code you provided. Clicked the return as tagged text box in the create rule screen. In the variable text editor window I inserted the rule as the first item in the window. All text is still black even though the rule validates to Green. Am I putting it in the correct window? Quote Link to comment Share on other sites More sharing options...
draco66 Posted October 12, 2016 Author Share Posted October 12, 2016 I rebooted everything and started with a new template. It works now. Sorry for the confusion and thank you for the input. Bob M. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.