cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Is there any way to get all the components associated with respective page?

Madhukar565
Explorer
0 Kudos
211

Hi Team,

As in one of my requirement, I need to get all the components associated with the page. Also the component may have the child components as well.

Is there any way to get all the components and sub components associated to the page?

Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

romitchhabra
Participant
0 Kudos

Yes I wrote a script few years back to get that. I remember vaguely that I got all the content slots etc. and then components. I had to prepare the list of component types to be picked as well for some reason which I don't remember exactly. But yes it is certainly possible, pickup the page, and go through the type hierarchy and get the types till you get the components.

For getting sub-components, you can create a list of component types which can have sub types and which cannot have, then depending on the type of component dig further and get the sub component.