on 2021 Mar 04 4:12 AM
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
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.