Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

AEM 6.3 Content Fragment JSON Aggregator


Level 2

I have a folder in my DAM that has multiple content fragments.

Folder: /content/dam/brand/cfs/blog

Content Fragment 1: /content/dam/brand/cfs/blog/blog-post-1

Content Fragment 2: /content/dam/brand/cfs/blog/blog-post-2

Content Fragment 3: /content/dam/brand/cfs/blog/blog-post-3

The overall goal is to have a single json page that has the information of all the content fragments inside the blog folder.

One method suggested was to create a page where the author will need to drag in content fragment components and link to the content fragment. And then use .model.json to generate a giant json from the page that has all the content fragments. But this method requires an extra step that would require the author to go to the page all the content fragments live on and drag the new content fragment if we want the content fragment to show up in the json.

My question ...

Is there a way to maybe build a component or a different method that can scrub the parent folder that has all the content fragments to automatically generate a master json of all the content fragments without the requirement of having the author make an extra step to add the content fragment onto the page that has all the content fragments for it to appear in the json.

The idea is that we want to use content fragments to build a blog. So each content fragment is essentially a blog post created by an author. And we want this aggregated json of all the blog posts/content fragments to live somewhere to be used by our external mobile app which will link to that master json file.page.

1 Reply


Level 10

I am not sure this can be done. If you want to use Content fragments on a blog - why not use them like normal components. Drag the content fragments into a blog and author them. See here:

Adobe Experience Manager Help | Using Content Fragments in AEM