Jump to content

Rule works when validated, but not when previewed


Recommended Posts

Hi Everyone, so I'm having a little trouble applying a line break rule to a business card template that I've been working on. Basically I have a line of input, and I want my customers to be able to insert a semicolon (or other character) to break their lines where they please. Although I'm not the most fluent person in javascript, my code works when I validate, but when I click okay and apply it to my template, it neither works when I preview it or when I compose it.

 

Currently, I have a rule stating:

return TaggedDataField("Position").replace(/; /g, "\n");

 

So far, I've tried many variations of this code with the "Treat returned strings as tagged text" box checked and unchecked, yet the semicolon still remains after I click okay.

 

I'm using FusionPro 9.2 right now if that helps,

 

If anyone knows a workaround that would be wonderful!

 

Thanks

Link to comment
Share on other sites

It's hard to say without knowing exactly what's in the data field. Also, are you sure you're actually calling out the rule, by the rule name, in a text frame, and not just the original field value?

 

Oops! I completely forgot to call out the rule.

That solved everything! Thanks

Link to comment
Share on other sites

Actually, as it turns out, I'm still getting the same problem even after replacing the data field in the text edit.

 

Now whenever I preview, the semicolon disappears, but the line still isn't breaking. Is it possible that there's a problem with PTI handling escape sequences such as "\n"? I've tried using <br> but the system doesn't recognize it as a page break and just prints out "<br>"

Link to comment
Share on other sites

Now whenever I preview, the semicolon disappears, but the line still isn't breaking. Is it possible that there's a problem with PTI handling escape sequences such as "\n"? I've tried using <br> but the system doesn't recognize it as a page break and just prints out "<br>"

Check the "Treat returned strings as tagged text" box in the Rule Editor, and the <br> tag will be handled properly in the output.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...