Sightly in AEM 6.3: org.apache.sling.api.request.RecursionTooDeepException: | Community
Skip to main content
July 21, 2017
Solved

Sightly in AEM 6.3: org.apache.sling.api.request.RecursionTooDeepException:

  • July 21, 2017
  • 4 replies
  • 8123 views

In AEM 6.3 /apps/core, there is a list component. Try to reuse this component and just overwrite the item.html to make a news listing component.

I have a news component with title, date, content and News.java (using sling models: adaptables = SlingHttpServletRequest.class). 

A list component lists all news.

I reuse the list.html, however I have to modify the item.html to retrieve the news node. Don't know how exact to do that.

<sly  data-sly-resource="${resource @ appendPath='/jcr:content/root/news'}">

<div class="myproject-news"

     data-sly-use.article="myproject.news">

</sly>

        <h4 class="myproject-news-title">${ news.title }</h4>

But I am getting an error: org.apache.sling.api.request.RecursionTooDeepException:

Can anyone please help?

Thanks.

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 viveksachdeva

When you do

<sly  data-sly-resource="${resource @ appendPath='/jcr:content/root/news'}">

looks for all the resources/nodes under your current resource... Depending on where your resource to be rendered is located, you should be using :

<sly  data-sly-resource="${resource.path @ appendPath='/jcr:content/root/news'}">

or

<sly  data-sly-resource="${currentPage.path @ appendPath='/jcr:content/root/news'}">

4 replies

Feike_Visser1
Adobe Employee
Adobe Employee
July 22, 2017

Can you try the following?

Change this:

<sly  data-sly-resource="${resource @ appendPath='/jcr:content/root/news'}">

to

<sly  data-sly-resource="${'root/news' @ resourceType='your resource type'">

smacdonald2008
July 22, 2017

You can build news type components too using back end WCMUsePojo and multi field as shown here -- Scott's Digital Community: Creating an Adobe Experience Manager HTL component that displays a repeating data set

zeeshanKhan0786
July 22, 2017

Hi ,

I am not able to replicate this exception in your code because this exception is thrown by the Sling implementation if to many recursive content inclusions take place.

Why are you using the list component to make the News Component.you want to display the title,date and content of the news for that either use multifield in dialog and then iterate through the data and display it. Other wise make a simple dialog having three field Title of news(ton), Date of news(datefield), Content(RTE) .At every new news drag and drop the component and fill the data into the dialog and display it for displaying below is the modiified code.

<div class="myproject-news">

        <h4 class="myproject-news-title">${properties.title}</h4>

          <h3> ${properties.date}</h3>

          {properties.content @ context='html'}

</div>

where date = name of date field in dialog (./date)

title =name of title in dialog (./title)

content = name of content (./content)

Thanks

viveksachdeva
Community Advisor
viveksachdevaCommunity AdvisorAccepted solution
Community Advisor
July 24, 2017

When you do

<sly  data-sly-resource="${resource @ appendPath='/jcr:content/root/news'}">

looks for all the resources/nodes under your current resource... Depending on where your resource to be rendered is located, you should be using :

<sly  data-sly-resource="${resource.path @ appendPath='/jcr:content/root/news'}">

or

<sly  data-sly-resource="${currentPage.path @ appendPath='/jcr:content/root/news'}">