Iteration for all the child nodes is don and I'm trying to get a specific node name and return the property value of that node.
while (children.hasNext()) {
Page node = children.next();
Iterator<Page> child2 = node.listChildren(new PageFilter(request));
Page node2 = children2.next();
while (children2.hasNext()) {
Page node2 = child2.next();
---?
I need only one node from the child of first node of first level
A
a
b
c
B
d
e
f
C
g
h
i
I want to print only b from A and the rest should remain as it is. I'm trying the back end logic because the hideInNav page property hides all the navgation of that page and I want it to be hidden only from footer and not anywhere else.
A B C
b d g
e h
f i
f
Solved! Go to Solution.
Views
Replies
Total Likes
Get all pages(at all level) or Get immediate children pages
listChildren(Filter<Page> filter, boolean deep)
Get immediat page with name
If(page.getParent().hasChild('another-sibling-page')){
page.getPageManager().getContainingPage(another-sibling-page')
}
Get page Property
ValueMap getProperties()
Hi,
How are you identifying that you need (b from A), (d,e,f from B), (g, h, i from C) ?
If there is specific property in node, you can check for that property and value while iterating the child nodes.
or you can add a new property which needs to be visible and based on that property you can filter the nodes.
Let's assume that I do have below page taxonomy or content hierarchy -
Here we could see resource named: Equipment is having [/content/we-retail/language-masters/en/products/equipment] is having children like Surfing, Running, Water Ports and so on.
Now if I want to read resource named: The Stretch Longboard which is one of child of Surfing as shown below -
Then I could create a node object for Equipment and
Node euipmentNode = your logic to read node object associated with page named: Equipment
if(euipmentNode.hasNode('surfing')){
Node surfingNode = euipmentNode.getNode('surfing');
if(surfingNode.hasNode('the-streach-longboard')){
Node streachNode = surfingNode.getNode('the-streach-longboard');
// add logic to read property of streachNode
}
}
This is one approach came to my mind and please review.
Get all pages(at all level) or Get immediate children pages
listChildren(Filter<Page> filter, boolean deep)
Get immediat page with name
If(page.getParent().hasChild('another-sibling-page')){
page.getPageManager().getContainingPage(another-sibling-page')
}
Get page Property
ValueMap getProperties()
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies