# Create templates

> You can create a template by converting an existing campaign into a template.

> For the complete documentation index, see [llms.txt](https://docs.talon.one/llms.txt).

:::note
You cannot create a template in the following cases:

- If the campaign has the [referrals](/docs/product/campaigns/referrals/referral-overview)
  or [achievements](/docs/product/achievements/overview) feature enabled.
  See [Manage campaign features](/docs/product/campaigns/settings/manage-campaign-features).
- If the campaign does not have any [rules](/docs/product/rules/overview).
- If the campaign was
  [created from a template](/docs/product/campaigns/create-and-manage-campaigns#create-a-campaign-from-a-template).
- If the campaign contains a [value map](/docs/product/rules/manage-value-map).
- If the campaign uses an [Application cart item filter](/docs/product/applications/manage-application-cart-item-filters).
:::

To create a template:

1. On the leftmost menu, click <Templates className="icon"/> **Templates**.
1. Click **Create Template**.
1. In **Application**, select the Application that contains the campaign from which you
   want to create a template.
1. In **Campaign**, select the campaign from which you want to create a template.
1. Click **Create Template**.

   :::tip
   To create a template directly from a campaign, in the **Template** column of the campaign
   [in your Application](/docs/product/applications/display-campaigns.md#list-campaigns),
   click <Templates className="icon"/>.
   :::

1. In **Placeholders**, create placeholders to allow users to select a value that replaces an attribute in a condition.
   For more details, see [Use placeholders](#use-placeholders).
1. In **Attributes**, define default values of any [mandatory campaign attributes](/docs/product/applications/use-attributes.md#make-attributes-mandatory).
1. In **Budgets**, define [budgets](/docs/product/campaigns/settings/manage-campaign-budgets.md)
   for the campaigns created from this template.
1. If the [**Coupons** feature](/docs/product/campaigns/settings/manage-campaign-features.md)
   is enabled, in **Coupons**, define the characteristics of the coupon codes automatically
   generated by any **Create coupon code** effect in the rules of the campaigns created
   from the template. These settings can be overridden when creating the effects.
1. In **Details**, define the template's basic information.
   - In **Basic info**, type the following:
     - The **Name** under which the template appears in the Campaign Manager.
     - A **Description** to help you identify the template.
     - (Optional) **Tags**, separated by commas.
   - In **Instructions**, type an explanation for other users to better understand how to
     use this template.
   - In **Connected Applications**, from the dropdown, select the Applications where you
     want the template to be available.

   :::note
   - If the rules of the original campaign use [custom attributes](/docs/product/account/dev-tools/manage-attributes.md#create-a-custom-attribute),
   you can only connect the template to Applications where the custom attributes are available.
   - If the original campaign has [strikethrough rules](/docs/product/rules/create-and-manage-rules.md#create-a-strikethrough-rule),
   you can only connect the template to Applications that have [cart item catalogs](/docs/product/account/dev-tools/manage-cart-item-catalogs.md)
   connected to them.
   :::

1. In **Attributes**, define default values of any
   [mandatory campaign attributes](/docs/product/applications/use-attributes.md#make-attributes-mandatory).
1. In **Placeholders**, create placeholders to allow users to select a value that replaces
   an attribute in a condition. For more details, see
   [Use placeholders](#use-placeholders). Note that you can also [add a placeholder to
   the Rule
   Builder](/docs/product/campaigns/templates/create-templates.md#add-a-placeholder-to-the-rule-builder)
   at this step. Clicking **Save** applies all changes in the **Rule Builder** and
   **Placeholders** tabs.
1. In **Budgets**, define
   [budgets](/docs/product/campaigns/settings/manage-campaign-budgets.md) for the campaigns
   created from this template.
1. If the
   [**Coupons** feature](/docs/product/campaigns/settings/manage-campaign-features.md) is
   enabled, in **Coupons**, define the characteristics of the coupon codes automatically
   generated by any **Create coupon code** effect in the rules of the campaigns created
   from the template. These settings can be overridden when creating the effects.
1. In **Review and enable**, review the information and settings of the template.
1. Click **Activate Template**.

The template automatically appears as enabled on the <Templates className="icon"/> **Templates** page.

:::note
To save your changes and continue creating the template later, in the top-right corner of
the page, click **Save as Draft**. <StateLabel type="draft" name="Draft" /> templates
are available on the <Templates className="icon"/> **Templates** page.
:::

## Use placeholders

You can create placeholders to allow users to select a value that replaces an attribute in a condition. In
campaigns created from a template, users without permission to [create and edit campaigns](/docs/product/account/account-settings/manage-roles.md#create-a-role)
can only modify the placeholder values.

### Create a placeholder

To create a placeholder during [template creation](/docs/product/campaigns/templates/create-templates.md):

1. In **Placeholders**, click the **Placeholders** tab.
2. Click <Add className="icon"/> **Create Placeholder** and define the following
   parameters:
   - In **Name**, type a name for the placeholder.
   - In **Description**, type a description to help users identify and know how to use the
     placeholder.
   - In **Type**, from the dropdown, select a placeholder type.
   :::note
   - (Optional) If you select `Number` or `Percent` as the placeholder type, you can define a range for its value. This ensures that all campaigns created from the template have predefined limits.

       To do so, in **Value range (optional)**, enter minimum and maximum values for the range.

   - (Optional) If you select `List of strings` as the placeholder type, you can connect an attribute picklist or [cart item catalog](/docs/product/account/dev-tools/manage-cart-item-catalogs.md) to the placeholder. This provides a set of predefined values for the placeholder that you can choose from when creating a campaign from this template.

       To connect an attribute picklist or cart item catalog to the placeholder:
       1. Select **Type** as `List of strings`.
       1. Select **Connect to an attribute picklist or cart item catalog**.
       1. In **Attribute**, select the attribute you want to connect to the placeholder.

      If an attribute connects to both a picklist and a catalog, you can only see values from the catalog for the placeholder.
   :::

1. Click **Create Placeholder**.
1. Click **Save**.

The placeholder is displayed in the **Placeholders** tab, where you can edit or delete it.

### Add a placeholder to the Rule Builder

To add a placeholder to the Rule Builder during [template creation](/docs/product/campaigns/templates/create-templates.md):

1. In **Placeholders**, click the **Rule Builder** tab.

   :::tip
   You can add or remove cart item filters, conditions, and effects in the Rule Builder to
   customize your template as needed.
   :::

1. In the Rule Builder, click the attribute you want to replace with a placeholder. You
   can replace multiple attributes with the same placeholder.
1. From the [Attribute Selector](/docs/product/rules/overview.md#attribute-selector), select
   a <Attribute name="Placeholder" type="placeholder" /> you [created](#create-a-placeholder).
1. Click **Done**.

## Related pages

- [Mandatory attributes](/docs/product/applications/use-attributes.md#make-attributes-mandatory)
- [Create and manage rules](/docs/product/rules/create-and-manage-rules.md)
