How to get child nodes from the main child of the page

I want to get all the child nodetypes inside the main of the specific page in the controller. Could someone guide how to do that? I find one article but it is about the get all the child nodes under it at pagetree.

What I want is like that:

$query = new FlowQuery(array($node));
$query = $query->children(‘main’).children(’[instanceof Neos.NodeTypes:Text]’);
$nodes = $query->get()

Hi @nguonchhay

Try and look at this post frmo october

I’m sure that you can use that as reference for your task

Hi @sorenmalling,

I used to find that article but it does not match with my case. The article is about the find the document nodetypes from the pagetree. In my case, I want to find the content nodetype inside the the provided document nodetype children.

Ex: I have one document nodetype call “Page” and childNode “main” (content collection that specify at “.yaml”). What I want is to get all the “Text” content nodetype from the childNode “main” as well as possibility to add “Text” to the childNode “main” as well.

Use it as a reference and let your IDE and API help you find the methods you need :slight_smile:

The syntax is the same as Fusion (since it’s the same php classes operating) so if you have the Fusion code that does what you want, I’m sure that we can put it together. So try and post it here and let’s see where it takes us :slight_smile: