Jump to content

Hide pages on preview but show in composition


dml1280

Recommended Posts

I have this rule that is working great to only show what I need on preview:

//access the "isOnlinePreview" property and the "isPreview" property

onlinePreviewVal = FusionPro.Composition.JobOptions.isOnlinePreview;
desktopPreviewVal = FusionPro.Composition.isPreview;

//if this is a preview composition or a desktop preview
//then return the specified resource

if (onlinePreviewVal == "Yes" || desktopPreviewVal == true)
{
FusionPro.Composition.SetBodyPageUsage("Info",true);
FusionPro.Composition.SetBodyPageUsage("UV Back",false);
FusionPro.Composition.SetBodyPageUsage("Black Back",false);
FusionPro.Composition.SetBodyPageUsage("Back Black and White",true);
}

if (Field("Stock Option") == "Matte")
{
FusionPro.Composition.SetBodyPageUsage("Info",true);
FusionPro.Composition.SetBodyPageUsage("UV Back",false);
FusionPro.Composition.SetBodyPageUsage("Black Back",false);
FusionPro.Composition.SetBodyPageUsage("Back Black and White",true);
}


if (Field("Stock Option") == "Matte with UV")
{
FusionPro.Composition.SetBodyPageUsage("Info",true);
FusionPro.Composition.SetBodyPageUsage("UV Back",false);
FusionPro.Composition.SetBodyPageUsage("Black Back",true);
FusionPro.Composition.SetBodyPageUsage("Back Black and White",false);
}

if (Field("Stock Option") == "Silk Lam")
{
FusionPro.Composition.SetBodyPageUsage("Info",true);
FusionPro.Composition.SetBodyPageUsage("UV Back",false);
FusionPro.Composition.SetBodyPageUsage("Black Back",false);
FusionPro.Composition.SetBodyPageUsage("Back Black and White",true);
}

if (Field("Stock Option") == "Silk Lam with UV")
{
FusionPro.Composition.SetBodyPageUsage("Info",true);
FusionPro.Composition.SetBodyPageUsage("UV Back",false);
FusionPro.Composition.SetBodyPageUsage("Black Back",true);
FusionPro.Composition.SetBodyPageUsage("Back Black and White",false);
}

if (Field("Stock Option") == "Suede Lam")
{
FusionPro.Composition.SetBodyPageUsage("Info",true);
FusionPro.Composition.SetBodyPageUsage("UV Back",false);
FusionPro.Composition.SetBodyPageUsage("Black Back",false);
FusionPro.Composition.SetBodyPageUsage("Back Black and White",true);
}


if (Field("Stock Option") == "Suede Lam with UV")
{
FusionPro.Composition.SetBodyPageUsage("Info",true);
FusionPro.Composition.SetBodyPageUsage("UV Back",false);
FusionPro.Composition.SetBodyPageUsage("Black Back",true);
FusionPro.Composition.SetBodyPageUsage("Back Black and White",false);
}

 

How do I append this so that anything "with UV" should be set as such in the press file?

FusionPro.Composition.SetBodyPageUsage("Info",true);
FusionPro.Composition.SetBodyPageUsage("UV Back",true);
FusionPro.Composition.SetBodyPageUsage("Black Back",true);
FusionPro.Composition.SetBodyPageUsage("Back Black and White",false);

 

 

Thanks!

Link to comment
Share on other sites

It's hard to say without the whole job, and a complete description of the requirements, but I think the entire rule can just be this:

var withUV = !IsPreview() && Field("Stock Option").indexOf("with UV") > -1;
FusionPro.Composition.SetBodyPageUsage("UV Back", withUV);
FusionPro.Composition.SetBodyPageUsage("Black Back", withUV);
FusionPro.Composition.SetBodyPageUsage("Back Black and White", !withUV);

Link to comment
Share on other sites

  • 1 month later...

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...