How to fetch the child pages & grand child pages by using recursive method in SIGHTLY.(I already have the object which contains the list of pages from the sling model class) | Community
Skip to main content
Level 2
Jun 1, 2021 10:43 AM UTC
Solved

How to fetch the child pages & grand child pages by using recursive method in SIGHTLY.(I already have the object which contains the list of pages from the sling model class)

I have an object which contains all the list of child pages & grand child pages (object - brought from the sling model class). In the component html page, I want to write the code , which display all the parent and child/grand child pages using the RECURSIVE method.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Asutosh_Jena_
Asutosh_Jena_Accepted solution
New Participant
Jun 1, 2021 1:05 PM UTC

4 replies

arunpatidar
New Participant
Jun 1, 2021 6:31 PM UTC

Hi,

I would suggest returning the list of pages from the sling model itself.

Using HTL for this use case could be tricky.

Translate
Arun Patidar
Level 2
Jun 2, 2021 11:34 AM UTC

Hi @arunpatidar I am returning the list of pages from the sling model itself but to print the title of my pages everytime I need to fetch from the list and print. So, I want to a fetch the child pages from the object (object - which has list of pages returned from sling)in recursive way even in sightly (Example:- by using data-sly-template)

Translate
Asutosh_Jena_
Asutosh_Jena_Accepted solution
New Participant
Jun 1, 2021 1:05 PM UTC