Go Back   MarcomCentral (PTI) and FusionPro User Communities > Support > Fonts

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 9th, 2008, 03:42 PM
dougiann dougiann is offline
Forum n00b
 
Join Date: Dec 2008
Posts: 1
Default Losing ampersand using all caps rule

In an address line, I need the type to go to all caps, yet when doing this I lose all the special characters (ampersands, etc.)...I see on the forum that this is a known problem, yet I don't know how to program in J.S. so I need help. What do I do? I'm using the pre-formatted JS rules in FP for <allcaps> for the specific field...thanks for any help...
Reply With Quote
  #2  
Old December 16th, 2008, 02:11 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,408
Default Re: Losing ampersand using all caps rule

You need to use the NormalizeEntities function on "raw" text when it's in a rule with the "Treat returned strings as tagged text" box checked. Otherwise, there's no way for FusionPro's internal tag parser to know that you intend for an ampersand to be typeset literally instead of denoting an XML entity.

Basically, anywhere in your "Treat returned strings as tagged text" rule where you're calling the Field function, you should wrap that in a call to NormalizeEntities. For example, instead of this:
Code:
return '<uppercase>' + Field("Name") + '</uppercase>';
You should do this:
Code:
return '<uppercase>' + NormalizeEntities(Field("Name")) + '</uppercase>';
The other option is to let JavaScript handle the uppercase conversion, like so:
Code:
return Field("Name").toUpperCase();
In which case you can UNcheck the "Treat returned strings as tagged text" box.

I can't give you more specific advice about what to change in your rule unless you post the syntax.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
  #3  
Old April 8th, 2009, 02:18 PM
LeslieO LeslieO is offline
Forum n00b
 
Join Date: Sep 2008
Location: Phoenix, Az
Posts: 1
Default Revisited....Re: Losing ampersand using all caps rule

Quote:
Originally Posted by Dan Korn View Post
You need to use the NormalizeEntities function on "raw" text when it's in a rule with the "Treat returned strings as tagged text" box checked. Otherwise, there's no way for FusionPro's internal tag parser to know that you intend for an ampersand to be typeset literally instead of denoting an XML entity.

Basically, anywhere in your "Treat returned strings as tagged text" rule where you're calling the Field function, you should wrap that in a call to NormalizeEntities. For example, instead of this:
Code:
return '<uppercase>' + Field("Name") + '</uppercase>';
You should do this:
Code:
return '<uppercase>' + NormalizeEntities(Field("Name")) + '</uppercase>';
The other option is to let JavaScript handle the uppercase conversion, like so:
Code:
return Field("Name").toUpperCase();
In which case you can UNcheck the "Treat returned strings as tagged text" box.

I can't give you more specific advice about what to change in your rule unless you post the syntax.
Hi Dan,
I was trying to add the NormalizeEntities(Field("Name")) function to the Javascript version of the all caps rule but I can not figure out where to add the function.
The prebuilt rule is converted to:

Var1="Title";
CaseSelection="allcaps";

if(CaseSelection == "allcaps")

return ToUpper(Field(Var1));

if(CaseSelection == "smallcaps")

return "<smallcap>" + Field(Var1) + "</smallcap>";

if(CaseSelection == "propercase")

return ToTitleCase(Field(Var1));

if(CaseSelection == "lowercase")

return ToLower(Field(Var1));

Will you tell me where to add NormalizeEntities(Field("Name")) in this rule?
Also in another post you suggested that NormalizeEntities(Field("Name")) should be added to all return fields. Does that mean I should add it to the fields that return phone numbers in my BC?
I am using Fusion Pro designer 5.8P2c on a Mac for web to print.
Thank you for your help,
Leslie
Vertis Communications Phoenix
Reply With Quote
  #4  
Old April 8th, 2009, 03:52 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,408
Default Re: Revisited....Re: Losing ampersand using all caps rule

All you need to do to fix the problem is to uncheck the "Treat returned strings as tagged text" box. That's it. You don't need to edit the logic at all.

That said, the entire rule's logic reduces to this:
Code:
return ToUpper(Field("Title"));
Hypothetically, if you were to leave the "Treat returned strings as tagged text" box checked, then the place to add the call to NormalizeEntities would be around any call to the Field function, like so:
Code:
return ToUpper(NormalizeEntities(Field("Title")));
Basically, if that box is checked, then you need to make sure that you use NormalizeEntities for any text which might contain characters such as ampersands and less-than symbols, which would trip up the tagged markup parser. If the box is unchecked, then you need to make sure to NOT use NormalizeEntities, or else you'll see actual entities such as &amp; in your output.
Quote:
Originally Posted by LeslieO View Post
Also in another post you suggested that NormalizeEntities(Field("Name")) should be added to all return fields. Does that mean I should add it to the fields that return phone numbers in my BC?
It's highly unlikely that phone numbers are going to contain symbols such as ampersands and less-than signs which would be affected by NormalizeEntities, so, no, I wouldn't worry about it for those fields.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});

Last edited by Dan Korn; April 8th, 2009 at 04:07 PM..
Reply With Quote
Old November 30th, 2009, 08:45 AM
KristenBalla
This message has been deleted by KristenBalla.
  #5  
Old November 30th, 2009, 08:48 AM
KristenBalla KristenBalla is offline
Forum n00b
 
Join Date: Oct 2008
Posts: 9
Default Re: Losing ampersand using all caps rule

Hi Dan,

I've been having this same problem and have tried both of your suggestions....

I used the standard case selection rule while UNchecking "Treat returned strings as tagged text"

and I tried this rule with the "treat returned strings as tagged text" checked:
return '<uppercase>' + NormalizeEntities (Field("Title")) + '</uppercase>';Field("Title")

Both ways I get "&AMP; AMP;" when I type and ampersand in the online template. Can someone tell me what I'm doing wrong.

thanks!
Reply With Quote
  #6  
Old November 30th, 2009, 10:42 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,408
Default Re: Losing ampersand using all caps rule

Quote:
Originally Posted by KristenBalla View Post
Both ways I get "&AMP; AMP;" when I type and ampersand in the online template.
Do you mean MarcomCentral (FP Web)? If so, I would ask about the issue on that forum.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com.

Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs.

This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data.

Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages.

Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance.

Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support.

How To Ask Questions The Smart Way

The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript.

Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5.

return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)});
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:23 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.