Custom data type in content fragment to fetch values from data source | Community
Skip to main content
Nitin_laad
Community Advisor
Community Advisor
September 29, 2020
Solved

Custom data type in content fragment to fetch values from data source

  • September 29, 2020
  • 1 reply
  • 1333 views

Hi All, 

We have a requirement to fetch values from data source in content fragment, and for that we need a completely new custom data type in Content fragment model. 

Any reference link/suggestions how could we achieve this ??

Any help is appreciated. 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by BrianKasingli

@nitin_laad,

Absolutely.

You can find the list of content fragment, data types, configuration from here, http://localhost:4502/crx/de/index.jsp#/libs/settings/dam/cfm/models/formbuilderconfig/datatypes

1. Create the custominput component under /apps.my-site. Make sure you follow an implementation of how an existing data type has been implemented for the content fragment editor under /libs/settings/dam/cfm/models/formbuilderconfig/datatypes.

2. overlay /libs/settings/dam/cfm/models/formbuilderconfig/datatypes with /apps/settings/dam/cfm/models/formbuilderconfig/datatypes.

3. Use the Sling Resource Merger mechanism to add your custominput component under the datatypes node. Add the new node, /apps/settings/dam/cfm/models/formbuilderconfig/datatypes/custominput with configurations like (making sure that you take an existing content fragment data type component as inspiration and as an example for your own configuration, so you understand the structure of how to component is setup; also lets you understand the requirements to how you can create your own datatype component.

 

4. Test!

 

1 reply

BrianKasingli
Community Advisor and Adobe Champion
BrianKasingliCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
September 29, 2020

@nitin_laad,

Absolutely.

You can find the list of content fragment, data types, configuration from here, http://localhost:4502/crx/de/index.jsp#/libs/settings/dam/cfm/models/formbuilderconfig/datatypes

1. Create the custominput component under /apps.my-site. Make sure you follow an implementation of how an existing data type has been implemented for the content fragment editor under /libs/settings/dam/cfm/models/formbuilderconfig/datatypes.

2. overlay /libs/settings/dam/cfm/models/formbuilderconfig/datatypes with /apps/settings/dam/cfm/models/formbuilderconfig/datatypes.

3. Use the Sling Resource Merger mechanism to add your custominput component under the datatypes node. Add the new node, /apps/settings/dam/cfm/models/formbuilderconfig/datatypes/custominput with configurations like (making sure that you take an existing content fragment data type component as inspiration and as an example for your own configuration, so you understand the structure of how to component is setup; also lets you understand the requirements to how you can create your own datatype component.

 

4. Test!

 

Nitin_laad
Community Advisor
Community Advisor
October 1, 2020
Thank you Brian, appreciate your help.