Content Fragment Model - customization - composite data structure | Community
Skip to main content
New Participant
July 20, 2021
Solved

Content Fragment Model - customization - composite data structure

  • July 20, 2021
  • 1 reply
  • 926 views

Hi,

 

I was trying to add custom fields to content fragment models. I wanted to keep image data as node below to have following schema /content/dam/my-model/image and there will be a list of props related to this image. 

 

I added the new editor type in /apps/settings/dam/cfm/models/formbuilderconfig/datatypes/items/image

 

Moreover I created my custom property definition basing on /libs/dam/cfm/models/editor/components/datatypeproperties/maptopropertyfield and removed "field-propertyName-validator" to bypass the name of the field validation (/ was not allowed to use)

 

 

After that I wanted to create example model but in the result I got the error:

 

It looks that AEM tries to add lastModified property for each field and if fails on more sophisticated data structure.

 

Does it mean that content fragment was designed only to keep flat models and I am heading in wrong direction?

What should I use to model the composite data structure?

 

 

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 Kishore_Kumar_

hi @piotrr ,

 

Yes, as of now Content Fragments doesn't support to have composite field structure. To overcome this Fragment Reference can be used to have a nested content. 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/assets/content-fragments/content-fragments-models.html?lang=en 

If you are planning to use Content Fragments as an API, AEM aaCS GraphlQL comes with segmented json output for this.

1 reply

Kishore_Kumar_
Kishore_Kumar_Accepted solution
New Participant
August 7, 2021

hi @piotrr ,

 

Yes, as of now Content Fragments doesn't support to have composite field structure. To overcome this Fragment Reference can be used to have a nested content. 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/assets/content-fragments/content-fragments-models.html?lang=en 

If you are planning to use Content Fragments as an API, AEM aaCS GraphlQL comes with segmented json output for this.