carloscastro Posted August 15, 2016 Share Posted August 15, 2016 Hello I'm using formatted text to create different paragraph styles, I have a question regarding how to include a bullet point of any other color than the paragraph color, can you help? you posted a thread of how to change a bullet point color returning a field, this time i'm trying to return the resource + the bullet point color changed. return Field("name").replace(/•/g,'<color name="THR Blue">•</color>'); thanks in advance Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted August 15, 2016 Share Posted August 15, 2016 You don't need a JavaScript rule. Just copy the bullet character • into the Text Editor, highlight it, and select whatever color you want. Then put the rest of the text in whatever other color you want. Quote Link to comment Share on other sites More sharing options...
carloscastro Posted August 15, 2016 Author Share Posted August 15, 2016 It works only on the first line, see attachment Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted August 16, 2016 Share Posted August 16, 2016 It works only on the first line, see attachment Well, I only see one bullet, and it seems to be in a different color than the text. So what's not working? How are you getting that output? I need a bit more to go on to troubleshoot. Maybe attach a minimal FusionPro template that demonstrates it. Quote Link to comment Share on other sites More sharing options...
carloscastro Posted August 16, 2016 Author Share Posted August 16, 2016 Here's the file, I'm trying to make a bullet point list, I used formatted text inside a rule, I hope it makes more sense when you see the file. I have another question regarding formatted text, I'm using suppress if empty check box, but there is an extra space when that field is missing, and I don't know where to change it.TESTFLY3-000-XX-00-16 EP.zip Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted August 16, 2016 Share Posted August 16, 2016 Thanks for attaching the job. My first thought is that this seems unnecessarily complicated. You have a text frame, which calls out the rule "Professionalmem_PRULE", which returns the resource "PROFESSIONA_P", which in turn calls out the field "PROFESSIONAL MEMBERSHIPS (3-4 bullet points)". I don't see a need for a resource in there at all; just call out the data field directly in the text frame, and if you need to do something to tweak it, you can just call out a rule which returns the data field. The resource only adds an extra layer of complexity. So the "Professionalmem_PRULE" rule can just do this to show the data in the output: return Field("PROFESSIONAL MEMBERSHIPS (3-4 bullet points)"); And now we're back to the original problem, where you need to figure out how to change the color of the bullets in there. So we're basically back to the example in your first post: return Field("PROFESSIONAL MEMBERSHIPS (3-4 bullet points)").replace(/•/g,'<color name="THR Blue-CMYK">•</color>'); This seems like it should work, and it does work in the Rule Editor when you click Validate, but there's a bit of hidden complexity at composition time, where the bullet character is sometimes treated as an eight-bit Latin-1 or Mac Roman character, and sometimes as a 16-bit Unicode character. And it can also be represented as an entity (•) in certain cases. This should handle all of those cases: var bulletMatcher = new RegExp("([" + [Chr(149), Chr(165), Chr(8226)].join("") + "]|•)", "g") return TaggedDataField("PROFESSIONAL MEMBERSHIPS (3-4 bullet points)").replace(bulletMatcher, '<color name="THR Blue-CMYK">$1</color>'); Note the call to TaggedDataField there. You probably want to do that anyway, in case the field contains certain characters which could be otherwise mistaken as tagged markup. This will also work correctly if the job is composed in MarcomCentral, where the data file actually is tagged markup. Quote Link to comment Share on other sites More sharing options...
carloscastro Posted August 17, 2016 Author Share Posted August 17, 2016 Yes you are correct, but that was my last resource, I had issues formatting the paragraphs, every time that the end user wanted to hit the return ket, it won't go down, and the only way to"fix" it was making a formatted text resource. 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.