Jump to content

Switching between different fronts and backs


WBG-guy

Recommended Posts

I have a business card that has different options for fronts and backs depending on what they choose. Our client wanted to add another back option but I'm unable to make it work.

 

Here are the possible fronts and backs

 

In the "card" Field they choose...

 

1. snowbasin (front=snowbasin, back=sunvalley)

2. sunvalley (f=sunvalley, b=back)

3. SV. Condominium Op. (f=sunvalley, b=back)

4. Retail (f=Retail, b=retailback) NEW BACKER OPTION

5. Recreation (f=sunvalley, b=recback)

 

Here's the old script I had that worked...

 

if (Field("card") == "snowbasin")

{

FusionPro.Composition.SetBodyPageUsage("snowbasin",true) ;

}

else if (Field("card") == "sunvalley")

{

FusionPro.Composition.SetBodyPageUsage("sunvalley",true) ;

}

else if (Field("card") == "SV. Condomminium Op.")

{

FusionPro.Composition.SetBodyPageUsage("sunvalley",true) ;

}

else if (Field("card") == "Retail")

{

FusionPro.Composition.SetBodyPageUsage("Retail",true) ;

}

else if (Field("card") == "Recreation")

{

FusionPro.Composition.SetBodyPageUsage("sunvalley",true) ;

FusionPro.Composition.SetBodyPageUsage("recback",true) ;

FusionPro.Composition.SetBodyPageUsage("back",false) ;

}

 

Its been a while since I edited this script so anything you can do to help fix would be greatly appreciated. Thanks

Edited by WBG-guy
Missed some information
Link to comment
Share on other sites

Try using a switch statement to accomplish this and clean up the code a little bit:

 


switch (Field("card")) {
    case "snowbasin":
           FusionPro.Composition.SetBodyPageUsage("snowbasin",true);
           FusionPro.Composition.SetBodyPageUsage("sunvalley",true);
     break;

    case "sunvalley":
    case "SV. Condominium Op.":
           FusionPro.Composition.SetBodyPageUsage("sunvalley",true);
           FusionPro.Composition.SetBodyPageUsage("back",true);
     break;

     case "Retail":
           FusionPro.Composition.SetBodyPageUsage("Retail",true);
           FusionPro.Composition.SetBodyPageUsage("retailback",true);
     break;

     case "Recreation":
           FusionPro.Composition.SetBodyPageUsage("sunvalley",true);
           FusionPro.Composition.SetBodyPageUsage("recback",true);
     break;
}

Link to comment
Share on other sites

Yes. Are you asking because you did that and it didn't work?

 

After re-reading the entire thread, I'm not sure why Alex suggested setting the first page to "used". They should all be set to "unused" and turned on via the OnRecordStart rule so that you only end up with 2 pages (front and back) per record.

Edited by step
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...