Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
I am trying to display the number of Children within a specific Node ID.
I know the ID and that there are current 6 child documents under this specific node.
So i just want to display the number 6 as there are 6 children.
Im still an absolute newbie to Umbraco especially writing any razor code so if any help much appreaciated
Thanks
hi Jools
Please, show your Razir code - I will provide a fix
/Alex
This code should work with Umbraco 7:
var node = Umbraco.TypedContent(nodeId); var childAmount = node.Children.Count(); @childAmount
This works great Alex! :)
Just wondering also, is there a way of using the nodeName instead of the nodeID?
Thanks Alex for a quick response! I will give that a try when I’m back in tomorrow.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Display number of Children under a specific Node ID
Hi
I am trying to display the number of Children within a specific Node ID.
I know the ID and that there are current 6 child documents under this specific node.
So i just want to display the number 6 as there are 6 children.
Im still an absolute newbie to Umbraco especially writing any razor code so if any help much appreaciated
Thanks
hi Jools
Please, show your Razir code - I will provide a fix
/Alex
This code should work with Umbraco 7:
This works great Alex! :)
Just wondering also, is there a way of using the nodeName instead of the nodeID?
Thanks Alex for a quick response! I will give that a try when I’m back in tomorrow.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.