Before you start

Download the header-style and logo images, given below, on your local machine. The header of the shipping-address-add-update-form adaptive form uses the header-style and logo images. The header-style image appears on the right side of the header.

Get File

Get File

Step 1: Apply a theme to your adaptive form

Adaptive forms editor provides multiple out-of-the-box themes. If you plan not to use a custom style for your adaptive form, you can also publish your adaptive forms with an out-of-the-box theme. Themes are independent of adaptive forms. You can apply the same theme to multiple adaptive forms. To apply a theme to an adaptive form:

  1. Open the adaptive form for editing.

    http://localhost:4502/editor.html/content/forms/af/shipping-address-add-update-form.html

  2. Open properties of Adaptive Form container. In the properties browser, navigate to Basic > Adaptive Form Theme. The Adaptive Form Theme field lists all the out-of-the-box and custom themes. By default, the Canvas theme is applied.

  3. Select a theme from the Adaptive Form Theme field. For example, Survey theme. Tap aem_6_3_forms_save to apply the selected theme.

Adaptive form with the default theme

Figure: Adaptive form with the default theme

Adaptive form with the Survey theme

Figure: Adaptive form with the Survey theme

Step 2: Update your adaptive form

The design displayed above requires changes in placeholder text and logo of your existing adaptive form. Perform the following steps to make the required changes:

  1. Change the existing logo and text of the header. To remove the logo:

    1. Open the form in form editor.

      http://localhost:4502/editor.html/content/forms/af/shipping-address-add-update-form.html

    2. Tap logo image in the header component and tap cmppr properties. In the image property, tap X to remove the existing logo image.

    3. Tap upload, select the logo.png, and tap aem_6_3_forms_save to save the changes. The image was downloaded in the Before you start section.

    4. Tap header text, We.Retail, and tap aem_6_3_edit edit. Change header text to we retail. Apply bold formatting only to wein we retail.

    we-retail-logo-text

  2. Remove title and add placeholder text:

    1. Tap the Customer ID field and tap cmppr properties.
    2. Copy the content of the Title field to the Placeholder Text field.
    3. Delete the content of the Title field and tap aem_6_3_forms_save .
    4. Repeat the previous three steps for all the text boxes, numeric box, and email field in the form.

    updated-adaptive-form

Step 3: Create a custom theme for your adaptive form

You can use theme editor to create custom themes. The theme editor is an all-powerful WYSIWYG editor. It is a visual method to apply CSS to various components of an adaptive form. It provides finer controls to style components and panels of an adaptive form.

A theme is a separate entity like adaptive forms. It contains styles (CSS) for the components and panels of an adaptive form. Styles include CSS properties such as background colors, state colors, transparency, alignment, and size. When you apply a theme, the specified style is applied to the corresponding components of an adaptive form.

In this tutorial, you will style header and footer, text and numeric components, attachment component, and buttons. Let’s start with creating a theme:

Create a theme

  1. Log in to the AEM author instance and navigate to Adobe Experience Manager > Forms > Themes. The default URL is http://localhost:4502/aem/forms.html/content/dam/formsanddocuments-themes.

  2. Tap Create and select Theme. The Create Theme page with the fields required to create a theme appears. The Title and Name fields are mandatory:

    • Title: Specify a title of the theme. For example, Global Theme. The title helps you identify the theme from the list of themes.
    • Name: Specify the name of the theme. For example, Global-Theme. A node with the specified name is created in the repository. As you start typing a title, value for the name field is automatically generated. You can change the suggested value. The name field can include only alphanumeric characters, hyphens, and underscores. All the invalid inputs are replaced with a hyphen.
  3. Tap Create. A theme is created and a dialog to open the form for editing appears. Tap Open to open the newly created theme in a new tab. The theme opens in theme editor. For styling, the theme editor uses an out-of-the-box adaptive form shipped with AEM Forms.

    For information about using theme editor UI, see About the theme editor.

  4. Tap Theme Options theme-options > Configure. In the Preview Form field, select the shipping-address-add-update-form adaptive form, tap aem_6_3_forms_save , tap Save. Now, the theme editor is configured to use your own adaptive form instead of the default adaptive form. Tap Cancel to return to the theme editor.

    custom-theme

    Figure: Theme editor with the shipping-address-add-update-form adaptive form

    create-a-theme

    Figure: Adaptive form with the default form