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
SOLVED

How can we read the Content Fragment Model attributes in the Teaser/Carousel Component Model class to get them part of the model json?

Avatar

Level 1
Level 1

Hi All,

 

I need to read CF model attributes in a Teaser or Carousel component to add custom properties based on the attributes of the CF model. I tried to read the CF model json through SlingRequestProcessor.processRequest(), but its deprecated and also the model json response is getting truncated (not getting the full response). Do we have any alternates to SlingRequestProcessor? 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @vs5 
This is very old article but not sure if it is useful to you or not.

https://aemlab.blogspot.com/2018/09/aem-content-fragment-with-component.html 



Arun Patidar

View solution in original post

3 Replies

Avatar

Community Advisor

@vs5 

 

I am guessing that the CF is linked to the Teaser/Carousal, if thats the case, you can extend the Teaser/Carousal Sling Model via Delegation. Then add extra methods to expose related CF info.


Aanchal Sikka

Avatar

Correct answer by
Community Advisor

Hi @vs5 
This is very old article but not sure if it is useful to you or not.

https://aemlab.blogspot.com/2018/09/aem-content-fragment-with-component.html 



Arun Patidar

Avatar

Administrator

@vs5 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni