Template Parameters in AdBuilder Templates

Prev Next

Introduction

Template parameters in AdBuilder templates make it easier to configure and maintain the source of data for the Text elements in the templates.

Template parameters can be seen as a better way to configure "Get text from" functionality, allowing to centralize the support of the data source in one.

Configuration

The "Template Parameters" section in the "Edit Template" window allows to create and manage template parameters for the whole template. All the configured parameters can be used for any element on any page.

"Template Parameters" section in the Edit Template

Create New Template Parameter

To create a new template parameter, follow the below described steps:

  1. Open "Edit Template" window.

  2. In the "Template Parameters" section, click "Insert new Element".

  3. Click "Insert".

  4. Enter the name of the element in the "Name of Element" field. This value will be displayed in the list of parameters in the "Get text from" text element configuration and as a drop-down with options in the "Make Ad" window.

  5. In the "Get Text from" field, select module which will be a source of data for this template parameter.

  6. Select field in the "Field" drop- down. List of options in the "MakeAd" window is the list of values from the field selected here.

  7. Using the "Assign All Text" check box, or the "Assign Text" button, specify the list of options that will be available for selection in the "MakeAd" window.

  8. Configure other options if needed:

    Option name

    Description

    Hide Element in Editor

    Use the check box to hide or show the template parameter selectbox in the "MakeAd" window

    Preselect Output Item

    Use this check box only when the source of data is the "Output" ("Save to") module and preselection of the value from the created item is needed for populating template parameter value.


    An example can be Creative Automation Studio Print App, where template parameter needs to be prefilled with the field value of the created output item.


    Or where template parameter needs to be prefilled with the field value of the item created in the "Output" ("Save to") module as a result of "Save PDF" operation.

  9. Template parameter is saved automatically.

Copy, Edit, Delete Template Parameters

Use copy icon to make a copy of the selected template parameter

Use delete icon to make a remove selected template parameter

Clicking the template paramater name link allows to modify template paramater settings. All the changes are saved automatically.

To cancel changes, click "Cancel" in the "Edit Template" window. All the previsouly performed operations with template parameters will be canceled (creation, deletion, update and copy).

Configure Text Elements to use Template parameters

As mentioned previously, template parameters are designed to improve the process of working with "Get text from" fields, allowing to manage configuration and selection of options in 1 place.

To configure a Text element using previously created template parameters, follow the below steps:

  1. In the "Edit Template" window, create a new text element or click previously created one you want to modify.

  2. Expand the "Get Text from" field.

  3. In the "Params" section, select the template parameter you need.

  4. In the "Field" select box, select the field from which data needs to be taken to insert into the text element. Any field from the module the template parameter is mapped to can be selected.

  5. Enter other text element configuration parameters and save.

  6. You can create as many text elements on any template page you need, created template can be used across any number of pages and text elements.

Populating Text Elements from Template Paramaters

Once template parameters and text elements have been configured and saved in the "Edit Template", it is extremely easy to populate all the related text elements with data in the "MakeAd" window by just selecting the template parameter value.

This significantly reduces manual work of selecting values for each text element individually.

Configuration of the Text Font Color Using Template Parameters

To be able to define font color using template parameters, the following pre-configuration is needed:

  1. Module needs to be created storing CMYK values of the color(s)

  2. Template parameter needs to be created and mapped to the module that is either:

    • a module storing color values

    • module having module link pointing to the module storing color values

Example of the "Color" module configuration

Example of "Color" module entries

Configuration

Provided "Color" module(s) with corresponding fields have been configured, proceed with the following steps:

  1. Create a template paramater and select "Color" module as a source of data, or a module that contains a module link to the "Color" module.

  2. Configure template element as described earlier in the manual.

Example of configuration

  1. Create a text element, or use previously existing one.

  2. Click the "Font Setting" tab.

  3. Using the below example, enter the values of the CMYK using the template paramater and corresponding field representing "C" (Cyan), "M" (Magenta), "Y" (Yellow), "K" (Black values) in the "Font Color" input field.

Note!

Depending whether your template parameter is mapped directly to the "Color" module or to a module with a module link to the "Color" module, formula will be different.

Example of formula where template parameter is mapped to "Color" module directly

$params.get('color').fieldValue('Cyan')

Where:

  • color - is the name of the template parameter

  • Cyan - is the name of the field in the "Color" module

Example of formula where template parameter is mapped to "Color" module directly

$params.get('input').fieldValue('color').fieldValue('Cyan')

Where:

  • input - is the name of the template parameter mapped to module e.g. "Input"

  • color - is the name of the module link in the "Input" module pointing to the "Color" module

  • Cyan - is the name of the field in the "Color" module

Applying the Color

Font color will be applied to all the correspondingly configured text elements after seleting the the template parameter in the "MakeAd" window.

Configure Picture Elements to use Template parameters

To configure a Picture element using previously created template parameters, follow the below steps:

  1. In the "Edit Template" window, create a new picture element or click previously created one you want to modify.

  2. In the Picture Properties section, Expand the "Get Pictures From" field.

  3. In the "Params" section, select the template parameter you need.

  4. In the "Field" select box, select the field from which data needs to be taken to insert into the text element. Any field from the module the template parameter is mapped to can be selected.

  5. Enter other Picture Element configuration parameters and save.

  6. You can create as many picture elements on any template page you need, created template can be used across any number of pages and picture elements.

Important to know:

  • when parameter is selected in configuration then "Assign Pictures" option is hidden.

Populating Picture Elements from Template Parameters

Once template parameters and picture elements have been configured and saved in the "Edit Template", it is extremely easy to populate all the related text elements with data in the "MakeAd" window by just selecting the template parameter value.

This significantly reduces manual work of selecting values for each text element individually.

Important to know:

  • when parameter is selected in Picture field then in “PDF Editor“, pictures element selector is non editable.

  • crop tool doesn’t work in picture element where pictures received from the parameter.

Limitations

Use of params is not supported in color field configuration (PDF generation will fail)

Use of params is not supported in character and paragraph style configuration (PDF generation will fail)

If field prefilled by template parameter has been manually modified, it will not be updated on selecting another template parameter values in MakeAd window.