Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Hi,
I am using the below code to print list children items on page, but it's not working. Can anyone please suggest how to achieve this?
<ul data-sly-list.child="${currentPage.listChildren}">
entering <li>${child.title}</li>
</ul>
Regards
Solucionado! Ir para a Solução.
Visualizações
respostas
Total de curtidas
Hi,
It works thanks. If i have 3 inner pages b under a and c under b and i want to print all the inner pages how do i achieve it.
Regards
Visualizações
respostas
Total de curtidas
Looks like your syntax is correct. You can refer to http://blogs.adobe.com/experiencedelivers/experience-management/htl-intro-part-1/.
Visualizações
respostas
Total de curtidas
Indeed syntax looks ok, is there no <ul> displayed?
Visualizações
respostas
Total de curtidas
Given this page structure:
and this code:
<ul data-sly-list.child="${currentPage.listChildren}">
<li> entering: ${child.title}</li>
</ul>
Output is:
If you are not getting output - make sure that your page has child pages. The code works.
Visualizações
respostas
Total de curtidas
Hi,
It works thanks. If i have 3 inner pages b under a and c under b and i want to print all the inner pages how do i achieve it.
Regards
Visualizações
respostas
Total de curtidas
One way to do it is to use a bundled Java Class where you can put your logic and then return the result you want into your componentName.html.
Here is an example from https://docs.adobe.com/docs/en/htl/docs/use-api/java.html
package
org.example.app.components;
import
com.adobe.cq.sightly.WCMUse;
public
class
Info
extends
WCMUse {
...
}
Code samples are intended for illustration purposes only.
and, the data-sly-use statement must reference the fully qualified class name, as opposed to just the local class name:
<
div
data-sly-use.info
=
"org.example.app.components.info.Info"
>
<
h1
>${info.title}</
h1
>
<
p
>${info.description}</
p
>
</
div
>
Visualizações
respostas
Total de curtidas
Thanks for your mail, but i am looking to pull all the inner pages page under b which is under a. Please let me know how to achieve this?
Visualizações
respostas
Total de curtidas
I would implement this in Java and return a Map to the Sightly component.
Use the Page-api to call the right methods
Visualizações
respostas
Total de curtidas
Thanks for your mail. The below two lines are not giving me node name. In jsp it works, but not in sightly. Can you please share a sample code which has node conversion, page conversion etc.
node = currentPage.getContentResource().adaptTo(Node.class);
title = node.getName();
Visualizações
respostas
Total de curtidas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas