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.
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:
-
Open the adaptive form for editing.
http://localhost:4502/editor.html/content/forms/af/shipping-address-add-update-form.html
-
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.
-
Select a theme from the Adaptive Form Theme field. For example, Survey theme. Tap
Figure: Adaptive form with the default 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:
-
Change the existing logo and text of the header. To remove the logo:
-
Open the form in form editor.
http://localhost:4502/editor.html/content/forms/af/shipping-address-add-update-form.html
-
Tap logo image in the header component and tap
-
Tap upload, select the logo.png, and tap
-
Tap header text,
We.Retail
, and tapwe retail
. Apply bold formatting only towe
inwe retail
.
-
-
Remove title and add placeholder text:
- Tap the Customer ID field and tap
- Copy the content of the Title field to the Placeholder Text field.
- Delete the content of the Title field and tap
- Repeat the previous three steps for all the text boxes, numeric box, and email field in the form.
- Tap the Customer ID field and tap
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
-
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.
-
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.
-
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.
-
Tap Theme Options
Figure: Theme editor with the shipping-address-add-update-form adaptive form
Figure: Adaptive form with the default form