


Previously, we used a Simple content fragment model(OOTB) to create CF and reading programmatically using the Original rendition created under each file. The 6.5.10 simple fragment model is deprecated, so we created a new Content fragment model that does not create renditions.
Is anyone know why it is not creating any renditions under file with the new Content fragment model?
With Simple fragment Model it is creating rendition -
With New custom content fragment model --
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @ramaem12 ,
I am not sure on the renditions difference between two but i guess if you use Content Fragment API you just need a CF path to get its "Original" data.
//Get the resource of content fragment as below. Resource fragmentResource = resourceResolver.getResource(“/content/dam/fragments/my-test-fragment”); //Adapt it to a fragment resource if (fragmentResource != null) { ContentFragment fragment = fragmentResource.adaptTo(ContentFragment.class); Iterator<ContentElement> elements = fragment.getElements();
while (elements.hasNext()){
ContentElement element = elements.next();
} }
https://aemdeveloper.wordpress.com/2017/08/22/create-access-the-content-fragment-programmatically/
Hi @ramaem12 ,
I am not sure on the renditions difference between two but i guess if you use Content Fragment API you just need a CF path to get its "Original" data.
//Get the resource of content fragment as below. Resource fragmentResource = resourceResolver.getResource(“/content/dam/fragments/my-test-fragment”); //Adapt it to a fragment resource if (fragmentResource != null) { ContentFragment fragment = fragmentResource.adaptTo(ContentFragment.class); Iterator<ContentElement> elements = fragment.getElements();
while (elements.hasNext()){
ContentElement element = elements.next();
} }
https://aemdeveloper.wordpress.com/2017/08/22/create-access-the-content-fragment-programmatically/
Hi @ramaem12 ,
Yes, Can you please try on Vanilla instance and if issue still persist then raise issue to the concerned team.
Regards,
Sanjay
Hi,
When you are creating the content fragment could you please check the logs and let us know whats coming there.
The content is stored under data node in latest AEM versions(not sure from which version), refer to the below image. The rendition folder is empty but the variations and the content is stored under data node
I was using specific logic to handle this - https://github.com/adobe/aem-core-wcm-components/blob/master/bundles/core/src/main/java/com/adobe/cq... (Just for your info) but as @Kishore_Kumar_ mentioned use the Content Fragment API to fetch the content.
Regards
Albin I