蜜豆视频

Getting Started with Edge Delivery Services for AEM Forms using Universal Editor

Authoring Method
Guide
Universal Editor (WYSIWYG)
This article
Document-based Authoring
Document-based tutorial

Edge Delivery Services for AEM Forms combines high-performance web delivery with WYSIWYG authoring in Universal Editor. This guide covers creating, customizing, and publishing fast-loading forms.

What You鈥檒l Accomplish

By the end of this tutorial, you will:

  • Set up a GitHub repository with the Adaptive Forms Block
  • Create an AEM Site integrated with Edge Delivery Services
  • Build and publish forms using Universal Editor
  • Configure local development environment

Choose Your Path

Select the approach that matches your scenario:

Choose Your Path Decision Guide
Figure: Visual guide to help you choose the right implementation path

Path A: New Project
Path B: Existing Project
Start with a pre-configured template
Add forms to your current AEM project
Best for: New implementations
Best for: Existing AEM Sites
What you get: Pre-configured Forms Block
What you get: Forms added to existing site
Steps: Template 鈫 Setup 鈫 Forms
Steps: Integration 鈫 Configuration 鈫 Forms
Start with Path A
Start with Path B

Prerequisites

To ensure a smooth and successful experience with Edge Delivery Services for AEM Forms using Universal Editor, review and confirm the following prerequisites before proceeding:

Access Requirements

  • GitHub Account: You must have a GitHub account with permissions to create new repositories. This is essential for managing your project source code and collaborating with your team.
  • AEM as a Cloud Service Authoring Access: Ensure you have author-level access to your AEM as a Cloud Service environment. This access is required to create, edit, and publish forms.

Technical Requirements

  • Familiarity with Git: You should be comfortable performing basic Git operations such as cloning repositories, committing changes, and pushing updates. These skills are fundamental for source control and project collaboration.
  • Understanding of Web Technologies: A working knowledge of HTML, CSS, and JavaScript is recommended. These technologies form the foundation of form customization and troubleshooting.
  • Node.js (version 16 or higher): Node.js is required for local development and running build tools. Ensure you have version 16 or later installed on your system.
  • Package Manager (npm or yarn): You will need either npm (Node Package Manager) or yarn to manage project dependencies and scripts.
  • AEM Sites Concepts: A basic understanding of AEM Sites, including site structure and content authoring, will help you navigate and integrate forms effectively.
  • Form Design Principles: Familiarity with best practices in form design鈥攕uch as usability, accessibility, and data validation鈥攚ill enable you to create effective and user-friendly forms.
  • Experience with WYSIWYG Editors: Prior experience using What You See Is What You Get (WYSIWYG) editors will help you leverage the Universal Editor鈥檚 visual authoring capabilities more efficiently.
TIP
New to AEM? Start with the AEM Sites Getting Started Guide.

Path A: Create a New Project with Forms

Recommended for: New projects, pilots, or proof-of-concept initiatives

Leverage the AEM Forms Boilerplate to accelerate your project setup. This boilerplate offers a ready-to-use template that seamlessly integrates the Adaptive Forms Block, enabling you to quickly build and deploy forms within your AEM Site.

Overview

To successfully launch your new project with integrated forms, you will:

  1. Create a GitHub repository using the AEM Forms Boilerplate template.
  2. Set up AEM Code Sync to automate content synchronization between AEM and your repository.
  3. Configure the connection between your GitHub project and your AEM environment.
  4. Establish and publish a new AEM Site.
  5. Add and manage forms using the Universal Editor.

The following sections will guide you through each step in detail, ensuring a smooth and efficient project setup experience.

Step 1: Create GitHub Repository from Template
  1. Access the AEM Forms Boilerplate template

    • Go to

    AEM Forms Boilerplate Template
    Figure: AEM Forms Boilerplate repository with pre-configured Adaptive Forms Block

  2. Create your repository

    • Click Use this template > Create a new repository

    Create Repository from Template
    Figure: Using the template to create a new repository

  3. Configure repository settings

    • Owner: Select your GitHub account or organization
    • Repository name: Choose a descriptive name (e.g., my-forms-project)
    • Visibility: Select Public (recommended for Edge Delivery Services)
    • Click Create Repository

    Repository Configuration
    Figure: Configuring your new repository with public visibility

Validation: Confirm you have a new GitHub repository based on the AEM Forms Boilerplate template.

Step 2: Install AEM Code Sync

AEM Code Sync automatically synchronizes content changes between your AEM authoring environment and your GitHub repository.

  1. Install the GitHub App

    • Go to
  2. Configure access permissions

    • Select Only select repositories
    • Choose your newly created repository
    • Click Save

    AEM Code Sync Installation
    Figure: Installing AEM Code Sync with repository-specific permissions

Checkpoint: AEM Code Sync is now installed and has access to your repository.

Step 3: Configure AEM Integration

The fstab.yaml file connects your GitHub repository to AEM authoring environment for content synchronization.

  1. Navigate to your repository

    • Go to your newly created GitHub repository
    • You should see the AEM Forms Boilerplate files
  2. Create the fstab.yaml file

    • Click Add file > Create new file in the root directory
    • Name the file fstab.yaml

    Creating fstab.yaml file
    Figure: Creating the fstab.yaml configuration file

  3. Add your AEM connection details

    Copy and paste the following configuration, replacing the placeholders:

    code language-yaml
    mountpoints:
      /: https://<aem-author>/bin/franklin.delivery/<owner>/<repository>/main
    

    Replace:

    • <aem-author>: Your AEM as a Cloud Service author URL (e.g., author-p12345-e67890.adobeaemcloud.com)
    • <owner>: Your GitHub username or organization
    • <repository>: Your repository name

    Example:

    code language-yaml
    mountpoints:
      /: https://author-p12345-e67890.adobeaemcloud.com/bin/franklin.delivery/mycompany/my-forms-project/main
    

    Editing fstab.yaml file
    Figure: Configuring the mountpoint for AEM integration

  4. Commit the configuration

    • Add a commit message: 鈥淎dd AEM integration configuration鈥
    • Click Commit new file

    Committing fstab changes
    Figure: Committing the fstab.yaml configuration

Validation: Confirm your GitHub repository connection to AEM.

code language-none
    <div class="extension note">
    <div>NOTE</div>
    <div>
    <p>Having build issues? See <a href="#troubleshooting-github-build-issues">Troubleshooting GitHub build issues</a>.</p>
    </div>
    </div>
Step 4: Create an AEM Site connected to your GitHub repository.
  1. Access the AEM Sites console

    • Log into your AEM as a Cloud Service authoring instance
    • Navigate to Sites

    AEM Sites Console
    Figure: Accessing the AEM Sites console

  2. Start site creation

    • Click Create > Site from template

    Create Site Option
    Figure: Creating a new site from template

  3. Select the Edge Delivery Services template

    • Choose the Edge Delivery Services Site template
    • Click Next

    Site Template Selection
    Figure: Selecting the Edge Delivery Services site template

    note note
    NOTE
    Template not available? If you don鈥檛 see the Edge Delivery Services template:
    1. Click Import to upload the template
    2. Download templates from
  4. Configure your site

    Enter the following information:

    table 0-row-3 1-row-3 2-row-3 3-row-3
    Field Value Example
    Site Title Descriptive name for site 鈥淢y Forms Project鈥
    Site Name URL-friendly name 鈥渕测-蹿辞谤尘蝉-辫谤辞箩别肠迟鈥
    GitHub URL Your repository URL https://github.com/mycompany/my-forms-project

    Site Configuration
    Figure: Configuring your new AEM site with GitHub integration

  5. Complete site creation

    • Review your settings
    • Click Create

    Confirm Site Creation
    Figure: Confirming site creation

    Success! Your AEM site is now created and connected to GitHub.

  6. Open in Universal Editor

    • In the Sites console, locate your new site
    • Select the index page
    • Click Edit

    Edit Site in Universal Editor
    Figure: Opening your site for editing

    The Universal Editor opens in a new tab, providing WYSIWYG authoring capabilities.

    Universal Editor Interface
    Figure: Your site opened in Universal Editor for WYSIWYG editing

Validation: Confirm your AEM site is ready for form authoring.

Step 5: Publish Your Site

Publishing makes your site available on Edge Delivery Services for global access.

  1. Quick publish from Sites console

    • Return to the AEM Sites console
    • Select your site pages (or select all with Ctrl+A)
    • Click Quick Publish

    Publishing AEM Site
    Figure: Selecting pages for quick publish

  2. Confirm publishing

    • In the confirmation dialog, click Publish

    Quick Publish Dialog
    Figure: Confirming the publish action

    Alternative: You can also publish directly from Universal Editor using the publish button.

    Publish from Universal Editor
    Figure: Publishing directly from Universal Editor

  3. Access your live site

    Your site is now live at:

    code language-none
    https://<branch>--<repo>--<owner>.aem.page/content/<site-name>/
    

    URL Structure Explained:

    • <branch>: GitHub branch (usually main)
    • <repo>: Your repository name
    • <owner>: Your GitHub username or organization
    • <site-name>: Your AEM site name

    Example:

    code language-none
    https://main--my-forms-project--mycompany.aem.page/content/my-forms-project/
    

Validation: Confirm your site is live on Edge Delivery Services.

note tip
TIP
URL Patterns:
  • Home page: https://<branch>--<repo>--<owner>.aem.page/content/<site-name>/
  • Other pages: https://<branch>--<repo>--<owner>.aem.page/content/<site-name>/<page-name>

Next: Create your first form

Path B: Add Forms to Existing Project

Best for: Existing AEM Sites with Edge Delivery Services

If you already have an AEM project using Edge Delivery Services, you can add form capabilities by integrating the Adaptive Forms Block.

Prerequisites for Path B

To proceed with integrating forms into your existing AEM project, ensure the following prerequisites are met:

  • You have an existing AEM project that was created using the .
  • You have a local development environment set up
  • You possess Git access to your project repository, allowing you to clone, modify, and push changes as needed.
NOTE
If your project was originally set up using the , form functionality is already included. In this case, you can move ahead to the Create Your First Form section.

The following guide provides a structured approach to adding form capabilities to your existing project. Each step is designed to ensure a seamless integration and optimal functionality within the Universal Editor environment.

Overview

You will complete the following high-level steps:

  1. Copy the Adaptive Forms Block files into your project.
  2. Update your project鈥檚 configuration to recognize and support form components.
  3. Adjust ESLint rules to accommodate the new files and coding patterns.
  4. Build your project and commit the changes to your repository.
Step 1: Copy Forms Block Files
  1. Navigate to your local project

    code language-bash
    cd /path/to/your/aem-project
    
  2. Download required files from AEM Forms Boilerplate

    Copy these files from the :

    table 0-row-3 1-row-3 2-row-3 3-row-3
    Source Destination Purpose
    blocks/form/ Core form functionality
    scripts/form-editor-support.js Universal Editor integration
    scripts/form-editor-support.css Editor styling
  3. Update editor support

    • Replace your /scripts/editor-support.js file with the

Validation: Confirm form block files are in your project.

Step 2: Update Component Configuration
  1. Update section model

    Open /models/_section.json and add form components to the filters:

    code language-json
    {
         "filters": [
         {
       "id": "section",
       "components": [
            "text",
            "image",
            "button",
         "form",
         "embed-adaptive-form"
       ]
        }
      ]
    }
    

    What this does: Enables form components in the Universal Editor component picker.

Validation: Confirm form components appear in Universal Editor.

Step 3: Configure ESLint (Optional)

Why this step: Prevents linting errors from form-specific files and configures proper validation rules.

  1. Update .eslintignore

    Add these lines to /.eslintignore:

    code language-bash
    # Form block rule engine files
    blocks/form/rules/formula/*
    blocks/form/rules/model/*
    blocks/form/rules/functions.js
    scripts/editor-support.js
    scripts/editor-support-rte.js
    
  2. Update .eslintrc.js

    Add these rules to the rules object in /.eslintrc.js:

    code language-javascript
    {
      "rules": {
        // Existing rules...
    
        // Form component cell limits
     'xwalk/max-cells': ['error', {
          '*': 4, // default limit
       form: 15,
       wizard: 12,
       'form-button': 7,
       'checkbox-group': 20,
       checkbox: 19,
       'date-input': 21,
       'drop-down': 19,
       email: 22,
       'file-input': 20,
       'form-fragment': 15,
       'form-image': 7,
       'multiline-input': 23,
       'number-input': 22,
       panel: 17,
       'radio-group': 20,
       'form-reset-button': 7,
       'form-submit-button': 7,
       'telephone-input': 20,
       'text-input': 23,
       accordion: 14,
       modal: 11,
       rating: 18,
       password: 20,
          tnc: 12
        }],
    
        // Disable this rule for forms
        'xwalk/no-orphan-collapsible-fields': 'off'
      }
    }
    

Validation: Confirm ESLint works with form components.

Step 4: Build and Deploy
  1. Install dependencies and build

    code language-bash
    # Install any new dependencies
    npm install
    
    # Build component definitions
    npm run build:json
    

    What this does:

    • Updates component-definition.json with form components
    • Generates component-models.json with form models
    • Creates component-filters.json with filtering rules
  2. Verify generated files

    Check that these files in your project root contain form-related objects:

    • component-definition.json
    • component-models.json
    • component-filters.json
  3. Commit and push changes

    code language-bash
    git add .
    git commit -m "Add Adaptive Forms Block integration"
    git push origin main
    

Validation: Confirm your project includes form capabilities.

Next: Create Your First Form

Create Your First Form

Who should follow this section:
This section is relevant for users following either Path A (new project) or Path B (existing project).

With your project now equipped for form creation, you are ready to build your first form using the Universal Editor鈥檚 intuitive WYSIWYG authoring environment. The following steps provide a structured approach to designing, configuring, and publishing a form within your AEM Site.

Overview

The process of creating a form in Universal Editor consists of several key stages:

  1. Insert the Adaptive Form Block
    Begin by adding the Adaptive Form Block to your chosen page.

  2. Add Form Components
    Populate your form by inserting components such as text fields, buttons, and other input elements.

  3. Configure Component Properties
    Adjust the settings and properties of each component to meet your form鈥檚 requirements.

  4. Preview and Test Your Form
    Use the preview functionality to validate the appearance and behavior of your form before publishing.

  5. Publish the Updated Page
    Once satisfied, publish your page to make the form available to end users.

The following sections will guide you through each of these steps in detail, ensuring a smooth and effective form creation experience.

Step 1: Add Adaptive Form Block
  1. Open your page in Universal Editor

    • Navigate to the Sites console in AEM
    • Select the page where you want to add a form (e.g., index)
    • Click Edit

    Your page opens in Universal Editor for WYSIWYG editing.

  2. Add the Adaptive Form component

    • Open the Content Tree panel (left sidebar)
    • Navigate to a section where you want to add your form
    • Click the Add (+) icon
    • Select Adaptive Form from the component list

    Adding Adaptive Form Block
    Figure: Adding an Adaptive Form block to your page

Validation: Confirm you have an empty form container.

Step 2: Add Form Components
  1. Navigate to your form block

    • In the Content Tree, locate your newly added Adaptive Form section

    Adaptive Form Block Added
    Figure: Adaptive Form block in the content tree

  2. Add form components

    You can add components in two ways:

    Method A: Click to Add

    • Click the Add (+) icon in your form section
    • Select components from the Adaptive Form Components list

    Method B: Drag and Drop

    • Drag components directly from the component panel to your form

    Adding Form Components
    Figure: Adding components to your form

    Recommended starter components:

    • Text Input (for name, email)
    • Text Area (for messages)
    • Submit Button
  3. Configure component properties

    • Select any form component

    • Use the Properties panel (right sidebar) to configure:

      • Labels and placeholders
      • Validation rules
      • Required field settings

    Component Properties Panel
    Figure: Configuring component properties

  4. Preview your form

    Your form will look something like this:

    Completed Form Preview
    Figure: Example form created with Universal Editor

Validation: Confirm your form is ready for publishing.

note important
IMPORTANT
Remember to publish your page after making changes to see updates in the browser.
Step 3: Publish Your Form
  1. Publish from Universal Editor

    • Click the Publish button in Universal Editor

    Publishing Form
    Figure: Publishing your form from Universal Editor

  2. Confirm publishing

    • In the confirmation dialog, click Publish

    Publish Confirmation
    Figure: Confirming the publish action

    You鈥檒l see a success message confirming publication.

    Publish Success
    Figure: Successful publication confirmation

  3. View your live form

    Your form is now live at:

    code language-none
    https://<branch>--<repo>--<owner>.aem.page/content/<site-name>/
    

    Example URL:

    code language-none
    https://main--my-forms-project--mycompany.aem.page/content/my-forms-project/
    

    Live Form Page
    Figure: Your published form page on Edge Delivery Services

Congratulations! Your form is now live and ready to collect submissions.

Next Steps

Now that you have a working form, you can:

  • Customize styling by editing CSS and JavaScript files
  • Add advanced form features like validation rules and conditional logic
  • Set up local development for faster iteration
  • Create standalone forms for specific use cases

Set Up Local Development Environment

Best for: Developers who want to customize form styling and behavior

A local development environment allows you to make changes and see them instantly without going through the publish cycle.

Set up AEM CLI and local development
  1. Install AEM CLI

    The AEM CLI simplifies local development tasks:

    code language-bash
        npm install -g @adobe/aem-cli
    
  2. Clone your repository

    code language-bash
    git clone https://github.com/<owner>/<repo>
    cd <repo>
    

    Replace <owner> and <repo> with your actual GitHub details.

  3. Start the local development server

    code language-bash
    aem up
    

    This starts a local server with hot-reload capabilities.

  4. Make customizations

    • Edit files in the blocks/form/ directory for form styling and behavior
    • Modify form.css for styling
    • Update form.js for behavior

    See changes instantly in your browser at http://localhost:3000

  5. Deploy your changes

    code language-bash
    git add .
    git commit -m "Custom form styling"
    git push origin main
    

    Your changes will be available at:

    • Preview: https://<branch>--<repo>--<owner>.aem.page/content/<site-name>
    • Production: https://<branch>--<repo>--<owner>.aem.live/content/<site-name>

Troubleshooting

Common Issues and Solutions

GitHub Build Issues

Problem: Build failures or linting errors

Solution 1: Handle Linting Errors

If you encounter linting errors:

  1. Open package.json in your project root

  2. Find the lint script:

    code language-json
    "scripts": {
      "lint": "npm run lint:js && npm run lint:css"
    }
    
  3. Temporarily disable linting:

    code language-json
    "scripts": {
      "lint": "echo 'skipping linting for now'"
    }
    
  4. Commit and push the changes

Solution 2: Module Path Errors

If you see 鈥淯nable to resolve path to module 鈥/scripts/lib-franklin.js鈥欌:

  1. Navigate to blocks/form/form.js

  2. Update the import statement:

    code language-javascript
    // Change this:
    import { ... } from '/scripts/lib-franklin.js';
    
    // To this:
    import { ... } from '/scripts/aem.js';
    
Form Functionality Issues

Problem: Form submissions not working

Solutions:

  • Ensure you have a submit button component
  • Check form action URL configuration
  • Verify form validation rules
  • Test in preview mode first

Problem: Styling issues

Solutions:

  • Check CSS file paths in blocks/form/
  • Clear browser cache
  • Verify CSS syntax
  • Test in the local development environment
Universal Editor Issues

Problem: Form components not appearing in Universal Editor

Solutions:

  • Verify AEM Code Sync is installed and running
  • Check that fstab.yaml has the correct AEM author URL
  • Ensure your AEM instance has early access enabled
  • Confirm component-definition.json includes form components

Problem: Changes not visible after publishing

Solutions:

  • Wait for CDN cache refresh
  • Check browser cache (try incognito/private mode)
  • Verify the correct URL format is being used
recommendation-more-help
fbcff2a9-b6fe-4574-b04a-21e75df764ab