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
June 1, 2021
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)

  • June 1, 2021
  • 2 replies
  • 2762 views

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.

2 replies

Asutosh_Jena_
Community Advisor
Asutosh_Jena_Community AdvisorAccepted solution
Community Advisor
June 1, 2021
arunpatidar
Community Advisor
Community Advisor
June 1, 2021

Hi,

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

Using HTL for this use case could be tricky.

Arun Patidar
Level 2
June 2, 2021

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)