AEM Form Fragments
AEM forms come with an extremely useful feature called form fragments. Form fragments are sections of a form that you can reuse across multiple forms on the site; for example, a signature or an address block. With form fragments, you can create multiple segments and use them throughout your forms.
In this example we will create an address block fragment:
Creating a fragment
- Click Create > Adaptive Form Fragment.
- Specify title (Address Block), description (Address block for work), and any necessary tags for the fragment (Optional).
- Click to open the Form Model tab, and from the Select From the drop-down menu, select the “none” option since we are creating a form fragment from scratch.
Save panel as a fragment
- Open an adaptive form that contains the panel you want to save as an adaptive form fragment.
- In the panel toolbar, click Save as Fragment. The Fragment Creation dialog opens.
- Fill in the necessary details for the fragment
- Click OK. The panel is saved at the specified or the default location in the repository.
Now that you’ve created a panel as a fragment we can insert it into an adaptive form.
- Open the adaptive form in which you want to insert the adaptive form fragment into
- Click the Adaptive Form Fragments tab in the AEM content finder. All available adaptive form fragments appear in the tab. Insert the “Address Block” form fragment that we just created into your form.
- Drag-and-drop an adaptive form fragment onto an adaptive form that you have already created.
Adaptive forms can be a lifesaver when you have hundreds (or thousands) of forms where you want to insert a common element. From our address block example above, you can see that you don’t need to re-create an address block each time you create a form, which is a huge time saver. It’s just one of the many advantages of AEM Forms. Be on the lookout for our next post in our AEM Forms series where we will talk more in-depth about managing assets.
No comments:
Post a Comment
If you have any doubts or questions, please let us know.