Jump to content

rpaterick

Registered Users - Approved
  • Posts

    432
  • Joined

Posts posted by rpaterick

  1. So all of the data changes per record for their unique URL or "PURL" for this campaign.

     

    Customer would like to do the following:

     

    Change this:

    www.Prepass66.Myprepassbenefits.com

     

    to this:

    www.Prepass66.MyPrePassBenefits.com

     

    My attempt to make this happen:

     

    return Field("Personalized URLs").replace(/[\Myprepassbenefits\>\/]/g,"MyPrePassBenefits");

     

    Basically, initial cap-case conversion for just part the Myprepassbenefits portion of the data.

  2. Also, I don't know that field you're trying to apply these rules to. The first rule calls out a field named "CardImage", while the second calls out a rule named "Full Name".

     

    So what are you really trying to do here? Are you trying to set the "CardImage" field, or the "Full Name" field? Or both, and if so, how are these rules related at all?

     

    Sorry Dan about the confusion.

     

    Here is a breakdown:

    Field Full Namein Data file needs to be capitalized, right now it's initial caps.

    The rule "Full Name On Card" is the ALL Caps rule that's needed.

     

    Whenever the name FREEDOM appears in the CardImage field, I need the font color to change to Full Name On Card. ColorRule should be then applied.

     

    So I'm trying to combine Full Name on Card and the CardImage Rules together to get the desired outcome, one rule.

     

    Thanks Dan, appreciate the help.

  3.  

     

    Thanks Dan.

     

    I'm trying to put it together now.

     

    Code for color:

     

    if (Field("CardImage") == "")
    return "";
    
    else
    return "CardImage: "+ "<color name = \"White\"> " + Field("CardImage") + "<color name= \"Black\">";

     

    Code to change the Full Name field to ALL CAPS.

     

    var Var1 = "Full Name";
    var 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));
    
    
    

     

    Put it together

     

    return '<ColorRule="' + Rule("Full Name On Card") + '">';

     

     

    I'm close but can't seem to get it to work. I might not be close either...:o

  4. switch (Field("Master Tier"))
    {
       case "Platinum Y Freedom":
       case "Platinum N Freedom":
           FusionPro.Composition.SetBodyPageUsage("2",true);
           FusionPro.Composition.SetBodyPageUsage("3",true);
           break;
    
       default:
           FusionPro.Composition.SetBodyPageUsage("1",true);
           FusionPro.Composition.SetBodyPageUsage("4",true);
    }
    

     

    Thanks Dan! I was trying to figure out how to cleanup the code and this did it!

     

    I have another question and it's not topic related here:

    Would you be able to direct me to a thread that deals with changing font color based on data input as well? Or is there something in the user manual that explains how to do this?

     

    Thanks Dan for your help!

  5. Need help in modifying the following code that is high-lighted in red:

    I'm not sure on how you do multiple data inputs for page switch/callout.

     

     

    if (Field("Master Tier") == "[color=Red]Platinum Y Freedom","Platinum N Platinum[/color]")
    {
       FusionPro.Composition.SetBodyPageUsage("2",true);
       FusionPro.Composition.SetBodyPageUsage("3",true);
    }
    else
    {
       FusionPro.Composition.SetBodyPageUsage("1",true);
       FusionPro.Composition.SetBodyPageUsage("3",true);
    }
    

     

     

    Thanks!

  6. sure, although (1) you don't specify what the field delimiter should be, and (2) your syntax isn't quite right. You need to add some literal delimiter characters in there, using the + (string concatenation) operator. Assuming that the fields within the address should be delimited with commas, as is the convention for mecard, this will probably work:

        
    adr: Optionalfieldorrule(addressfieldorrule) + "," + optionalfieldorrule(cityfieldorrule) + "," + optionalfieldorrule(statefieldorrule) + "," + optionalfieldorrule(zipfieldorrule),

    or, it might be easier to do all that on a different line, and assign the full address to another variable, which will make the code a little cleaner. So near the top of the rule, you can do this:

    var address = optionalfieldorrule(addressfieldorrule) + "," +
       optionalfieldorrule(cityfieldorrule) + "," +
       optionalfieldorrule(statefieldorrule) + "," +
       optionalfieldorrule(zipfieldorrule);

    or, even more succinctly:

    var address = [ optionalfieldorrule(addressfieldorrule),
       optionalfieldorrule(cityfieldorrule),
       optionalfieldorrule(statefieldorrule),
       optionalfieldorrule(zipfieldorrule) ].join();

    then the line setting the property of the "info" object can be simply:

        adr: Address,

    also, you could change all of those calls to optionalfieldorrule to call fieldorrule, or even simply field, instead, since the field names are all specified, hard-coded, at the top of the rule. Those are only set up to be optional for the xml template rule in case the user doesn't select anything in the drop-down list; but once you're in javascript, the field names are set.

     

    fantastic!!!:)

  7. The best thing to do is to find an example of a barcode that does scan successfully on your iPhone. Then, there should be an option in the barcode reader app to give you back the text contents of the barcode verbatim. Once you have that, you can write the rule so that it generates the barcode contents to match that format.

     

     

    It appears the previous print shop put the Address, City, State and Zip all in one column.

     

    Is there a way to use the "+" feature for concatenating in the QR code?

     

    something like this below....

        
    ADR:
    OptionalFieldOrRule(AddressFieldOrRule)
    OptionalFieldOrRule(CityFieldOrRule), + 
    OptionalFieldOrRule(StateFieldOrRule), +
    OptionalFieldOrRule(ZipFieldOrRule),

     

    Thanks Dan!

  8. Text field for QR Contact Information code:

    Full Name, Phone, Email, and Address work but I can't get the City, State, and Zip to populate(QR reader on a Iphone5).

     

    I tried to manipulate the code for the following fields:

    City

    State

    Zip

     

     

    var NameFieldOrRule = "Full Name";
    var PhoneFieldOrRule = "phone 1 number";
    var EmailFieldOrRule = "Email Address";
    var CityFieldOrRule = "City";
    var AddressFieldOrRule = "Address 1";
    var StateFieldOrRule = "State";
    var ZipFieldOrRule = "Zip";
    var PointSize = "";
    
    // MECARD format
    // http://www.nttdocomo.co.jp/english/service/imode/make/content/barcode/function/application/addressbook
    // Also see: http://code.google.com/p/zxing/wiki/BarcodeContents
    
    var info = {
       N: FieldOrRule(NameFieldOrRule),
       TEL: OptionalFieldOrRule(PhoneFieldOrRule).replace(/\D/g,''),
       EMAIL: OptionalFieldOrRule(EmailFieldOrRule),
       CITY: OptionalFieldOrRule(CityFieldOrRule),
       ADR: OptionalFieldOrRule(AddressFieldOrRule),
       State: OptionalFieldOrRule(StateFieldOrRule),
       ZIP: OptionalFieldOrRule(ZipFieldOrRule),
    }
    
    var result = "";
    for (var label in info)
    {
       if (!info[label])
           continue;
    
       result += label;
       if (!label.match(/\:$/))
           result += ":";
    
       result += info[label];
    
       result += FusionPro.inValidation ? '\r' : ';';
    }
    
    if (FusionPro.inValidation)
       return result;
    
    var QR = new QRBarcode;
    QR.pointSize = Int(PointSize) || 6;
    return QR.Make("MECARD:" + result + ";");
    
    

     

    Am I better off changing the QR Contact (vCard) - Graphic?

     

    Just wanted to see what direction to head.

     

    Thanks!

  9. Furthermore, you can probably accomplish what you need with some kind of copyfitting instead of calling out completely different resources or pages.

     

    The marketing designer has dictated how they want the smaller number of characters to break(paragraph) and longer characters to break.

     

    I did the "Len" formula in excel and then sorted to see where the breaking(text flow) issue for them is occurring, that they didn't like the text wrapping.

     

    Thanks Dan for your help this is very appreciated! :)

  10. Make them into images and then do a simple "switch" statement in fusionpro or...

     

    take those same images and create the following rule:

     

    return CreateResource(Field("version"));

     

    The data inputs have to be called the same as the IMAGES to call them out properly. Images have to be in the same PATH as your FusionPro template also(I think).

     

    Hopefully this gets you started and Dan may have a simpler way to do it also.

  11. return Field("Full Name").replace(/[\<\>\/.]/g," ").replace(/\d{4,}/g,'');

     

     

    Thanks Dan. I'm thinking of going in a different direction now.:o

     

    How can put in multiple formats of PHONE NUMBERS to be taken out?

     

    Example of different phone numbers that are formatted in the list.

    847 695 3250

    847-804-2108

    5214626

     

    How could I "build" up a code to put in different "#" scenarios(###-###-####, ###-####,(###)-###-####, etc..)

    that FusionPro would recognize and replace with nothing?

     

    Thanks Dan!!

  12. Seeing if this is possible?

     

    ex: RON CONLEY APARTMENTS 933

    This would be OK to leave the 933 in the record.

     

     

    ex: RON CONLEY APARTMENTS 9334

    ex: PEP BOYS 1407 4YD

    ex: 5806-TGC-280679-WEST CHICAGO

     

    I would like FusionPro to take out all of the numbers.

     

    Could be any combination of numbers and be anywhere in the cell placed. So basically if there are more than 4 numbers in the record, delete them.

     

    Thanks!

  13. Are you saying that out of 20,000 records, 293 records have the same name in fields Name1, Name2, and Name3? And you want them formatted differently?

     

    Can you post an example? Or better describe what you're asking?

     

    Out of the 20,000 records, there are 293 groups or 586 duplicate names.

     

    ex: Aaron Smith

     

    I have to have one Aaron Smith like this:

    AaronSmith@.edu

     

    The next Aaron Smith to come along needs to be like this:

    Aaron.Smith@.edu

     

    Both Aaron Smith's live at different addresses but would need their own "unique" purl ID when they log onto the website that is their own.

     

    Thanks!

×
×
  • Create New...