Expand my Community achievements bar.

Get ready! An upgraded Experience League Community experience is coming in January.
SOLVED

Extending Drag-and-Drop Fields in AEM Metadata Schemas

Avatar

Level 3

In the Metadata Schema Editor, the Build Form section provides a set of predefined drag-and-drop components. I wanted to check whether it’s possible to introduce a custom field type—for example, a link field—and define custom rules or behavior for it. If this is supported, what would be the recommended approach to implement it?

ac4320_0-1767022011629.png

 

1 Accepted Solution

Avatar

Correct answer by
Level 3
6 Replies

Avatar

Community Advisor

you need to overlay /libs/dam/gui/coral/components/admin/schemaforms/formbuilder/v2/builditems.jsp in your apps folder and create a new custom field in the /apps folder to be included in the overlayed jsp

Avatar

Level 3

Thanks! Can you provide any reference links/example wherein this has been implemented. It would also help if you could create some dummy field to demonstrate.

Avatar

Community Advisor

Avatar

Community Advisor

Hi @ac4320 ,

Here's the approach:

Create a custom component - Build your custom field component (like your link field) under /apps/dam/gui/coral/components/admin/customsearch/searchpredicates/ or a similar path
Define the component structure - Create the necessary files:

Component dialog (.content.xml)
Rendering script (HTL/JSP)
Client library for any custom JavaScript/CSS behavior

Register it in the Schema Editor - Add your custom component to the list of available fields by overlaying /libs/dam/gui/content/metadataschemaeditor/formbuilder and including your component in the allowed types
Implement custom logic - In your component, define:

How the field renders in the metadata editor
Validation rules
Save/retrieve behavior
Any custom JavaScript for interactions

If you just need a text field with link validation, you can extend the existing Single Line Text field and add custom validators through clientlibs rather than building from scratch.
The key is that your custom component needs to follow the Granite UI component structure and implement the proper interfaces for metadata field behavior.

Hrishikesh Kagane

Avatar

Community Advisor

Hi @ac4320 

You can also use granite type , however granite type are not available by drag and drop. You need to add those type similar to dialog.

You can also also clientlibs within form for validation.

 

e.g.

<clientlibs
                            jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/includeclientlibs"
                            categories="myproj.dam.metadataeditor.linkcheck"/>

 

Arun Patidar

AEM LinksLinkedIn

Avatar

Correct answer by
Level 3