How to set conditions to print sections

Hi,

I don’t have a good experience with PlanetPress and I’m in difficult to rebuild projects made in PrintShopMail.

About this question I don’t know how to set conditions to print sections in PlanetPress Designer like “Layout->Edit condition…” in PrintShopMail.

I would like to Print or Skip section when a condition is true or false. How can I do? Can you help me?

Thank you very much.

Kind Regards

Roberto

Once you add your object to a page in Connect Designer, select it, then right click for your menu options and pick ‘Make Conditional’.

Sorry Sayala,

My question is not related to the objects but to the whole page. Like in PrintShopMail 7:

http://help.objectiflune.com/en/printshop-mail-user-guide/7.2/Default_CSH.html#/160.html

Thank you very much.

Kind Regards

Roberto

Hello Roberto,

In closest thing is skipping and printing sections. This is achieved by creating a Control script in the Scripts panel. To insert a Control script click the New icon on the toolbar of the Scripts panel and choose Control script. Controls scripts run before the merge process and let you control various aspects of the document. Consider the following code:

// Simple approach to initially disable output for the Print sections
merge.template.contexts.PRINT.sections['Section 1'].enabled = false;
merge.template.contexts.PRINT.sections['Section 2'].enabled = false;

// Enable a print section based on the value of a data field
if(record.fields['Field1'] == 'goldmember') {
    merge.template.contexts.PRINT.sections['Section 1'].enabled = true;
} else {
    merge.template.contexts.PRINT.sections['Section 2'].enabled = true;
}

This script initially disables the two sections in my template and subsequently enables one of them based on a data field. Currently this can via scripting only, an user interface will be added in a future version.

Erik

PS. In many traditional PSM templates the skip/print layout option was used to toggle the background. In Connect this often translates to toggling an image on the master page (for example PDF dragged from the resources to Master Page editor) or use scripted media.

Many thanks Erik!! This is what I need.

I will do some tests today.

Kind Regards

Roberto