How can we read the Content Fragment Model attributes in the Teaser/Carousel Component Model class to get them part of the model json? | Community
Skip to main content
October 19, 2023
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?

  • October 19, 2023
  • 3 replies
  • 649 views

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? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

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 

3 replies

aanchal-sikka
Community Advisor
Community Advisor
October 19, 2023

@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
arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
October 19, 2023

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
kautuk_sahni
Community Manager
Community Manager
October 19, 2023

@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