Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.
Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.
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.
¡Resuelto! Ir a solución.
Vistas
Respuestas
Total de me gusta
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'}">
Vistas
Respuestas
Total de me gusta
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'">
Vistas
Respuestas
Total de me gusta
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 repeat...
Vistas
Respuestas
Total de me gusta
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
Vistas
Respuestas
Total de me gusta
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'}">
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas