What is the exact node type that must be used when defining a content fragment model?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @OmarKh3,
dam:Asset with a child node of type nt:data under jcr:content/data/master is used to store the content fragment, but the model itself must be of type nt:unstructured with cq:model mixin.
Hi @OmarKh3,
dam:Asset with a child node of type nt:data under jcr:content/data/master is used to store the content fragment, but the model itself must be of type nt:unstructured with cq:model mixin.
Hi @OmarKh3 ,
Whenever a content fragment model created, it will get created with jcr:primaryType="cq:Template"
Please find below sample content fragment model xml.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Template"
allowedPaths="[/content/entities(/.*)?]"
ranking="{Long}100">
<jcr:content
cq:lastModified="{Date}2025-07-15T19:44:29.080+05:30"
cq:lastModifiedBy="admin"
cq:scaffolding="/conf/we-retail/settings/dam/cfm/models/document/jcr:content/model"
cq:templateType="/libs/settings/dam/cfm/model-types/fragment"
jcr:primaryType="cq:PageContent"
jcr:title="Document"
sling:resourceSuperType="dam/cfm/models/console/components/data/entity"
sling:resourceType="dam/cfm/models/console/components/data/entity/default"
status="enabled">
<metadata jcr:primaryType="nt:unstructured"/>
<model
cq:targetPath="/content/entities"
jcr:primaryType="cq:PageContent"
sling:resourceType="wcm/scaffolding/components/scaffolding"
dataTypesConfig="/mnt/overlay/settings/dam/cfm/models/formbuilderconfig/datatypes"
maxGeneratedOrder="20">
<cq:dialog
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured"/>
</content>
</cq:dialog>
</model>
</jcr:content>
</jcr:root>
Whenever you want create a content fragment using existing model, then content fragment will get created with jcr:primaryType="dam:Asset".
Thanks
Ramesh
Views
Replies
Total Likes