---
title: "Create a web template"
slug: "create-a-web-template"
abstract: "Create web templates with HTML, CSS, JS, and FreeMarker in Sitecore Personalize, enhancing the marketer's experience with dynamic customization."
---
# Create a web template

Technical team members can create web templates using HTML, CSS, JavaScript, and FreeMarker.

You can optionally [create a form](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/developer-center/web-templates/create-a-web-template/create-a-form-for-a-web-template.html "Create a form for a web template") for the marketer to complete and render a preview as the marketer completes the form.

When you are ready to make the web template available to the marketer, change the status to published. When the marketer creates the web experiment or experience based off the web template, a form displays for them to apply further customization.

Team members with a *User*, *Developer*, or *Admin* role in Sitecore Cloud Portal can create a web template.

To create a web template:

1. On the navigation menu, click **Developer Center** > **Web templates**.
2. On the **Web Templates** page, click **Create**.
3. In the **Name your template** field, enter an intuitive name for the web template. As you type, the name of the template displays in the **ID** field.
4. Click **Create**. The template editor displays for you to customize using HTML, CSS, JavaScript, and FreeMarker, as shown in the following image.

    ![Configuring HTML in a web template.](https://doc.sitecore.com/api/markdown-image/personalize/en/users/sitecore-personalize/images/DevCenterWebtemplate.png)

5. To define the structure and content of the web template, use the **HTML**, **CSS**, **JavaScript**, and **API** tabs to add a custom code and configure the API response.

    When Sitecore Personalize [executes a variant](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/using-client-side-javascript-in-personalization.html "Using client-side JavaScript in personalization") for a web experiment or experience, it executes any HTML, CSS, or JavaScript configured in the variant. In order for personalization to work, the variant must pass any guest data to your organization's website, for example the guest's first name, location, loyalty number, etc. This information is known as server-side data. To facilitate, you must compose the API response using FreeMarker, then reference it in the relevant [HTML](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/introduction-to-experiments-in-sitecore-personalize/introduction-to-web-experiments-in-sitecore-personalize/create-a-web-experiment/use-html-in-a-web-experiment.html "Use HTML in a web experiment"), [CSS](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/introduction-to-experiments-in-sitecore-personalize/introduction-to-web-experiments-in-sitecore-personalize/create-a-web-experiment/use-css-in-a-web-experiment.html "Use CSS in a web experiment"), or [JavaScript](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/introduction-to-experiments-in-sitecore-personalize/introduction-to-web-experiments-in-sitecore-personalize/create-a-web-experiment/use-javascript-in-a-web-experiment.html "Use JavaScript in a web experiment") tab.

6. Click the **Settings** tab in the right pane and configure the following:
    - **Description**: Enter a description of the web template.
    - **Tile Image**: Click the ![Edit icon](https://doc.sitecore.com/api/markdown-image/personalize/en/users/sitecore-personalize/images/CDP_webtemp_pencilicon.png) icon to select an image that represents the type of web template. Only Sitecore CDP users will see this image.
    - **Render a Preview on the Experience**: Select this checkbox to render a preview of the web experiment or experience as the user completes the form. We recommend that you test that the web experience will successfully render before publishing. Do not use this option for more sophisticated web templates that use `handlebars` loops. The web experiment or experience will not render as the form is completed, because it needs to wait until the code finishes compiling.
7. Click **Save**.
8. To publish the web template, click the toggle switch to put the template in the *Published* state. This will make it available when a user creates a new experience or an experience variant using a web template.