How many Templates for an AEM Headless Implementation

Avatar

Avatar
Contributor 2
Level 8
AEM_Forum
Level 8

Likes

147 likes

Total Posts

631 posts

Correct reply

4 solutions
Top badges earned
Contributor 2
Validate 100
Validate 50
Validate 25
Validate 10
View profile

Avatar
Contributor 2
Level 8
AEM_Forum
Level 8

Likes

147 likes

Total Posts

631 posts

Correct reply

4 solutions
Top badges earned
Contributor 2
Validate 100
Validate 50
Validate 25
Validate 10
View profile
AEM_Forum
Level 8

05-04-2021

Hi,

 

1. For an AEM Headless Implementation, we create 1. content using Content Fragments and  2. define an AEM Content Services end-points using AEM Sites’ Templates and Pages that expose the  data as JSON.

How to know how many of Content Fragments and AEM Sites’ Templates are required for a specific implementation? Let us assume a medium sized implementation.

I am aware that it is dependent on functionalities.

Is there a thumb rule or so?

 

2. AEM Sling Models also expose the data to outside world as JSON. When should I use Sling Models Vs the above model?

 

Appreciate all your responses.

 

Thanks,

Rama.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct reply

173 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct reply

173 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile
kunal23
MVP

06-04-2021

You can start with one Experience Fragment Template and call it as CaaS API template. It will have a single container where authors can drop the components and refer content fragments. You will have to do a discovery exercise to find out how many content fragment models you need to create. As the content fragment models will be derived from the different CaaS use cases in your project. 

 

Regarding your second question regarding using Sling models. Yes that will work as well but you should also think about using the content in wider set of applications and how you will manage it. Lets say you have a carousel component and it has a sling model exporter. And you get a use case to expose its content to an external application.

Would you expose the JSON of the carousel directly from the created page in your website? You will probably create a new experience fragment with carousel dropped in it and then share that experience fragment JSON to external application. The reason you will do it this way is because this way the end consumers like website page can have their own separate life cycles or they are decoupled from each other. It can happen that the website page is unpublished as it is not required any more on the website but the external application still wants to consume the content. 

You can consider experience fragment template as an orchestration layer using which can produce different JSON outputs for different consuming applications. Suppose another application wants to consume the same carousel content but along with the carousel copy it may require another set of fields may be from another component or content fragment. In this case you can easily build a new experience fragment and create a dedicated API endpoint URL for the consuming application without affecting other applications which are only consuming the carousel copy. 

 

Also, now suppose there is another component in your website which requires same content copy on the carousel. But that is a different component? Now how will you share the content copy and manage it in one single place. Here the content fragments can come into play as you can manage the content copy in a central content fragment and expose it to carousel component as well as another component which requires the same content. 

 

I hope this answers your question. 

Answers (0)