I'm trying to create a usercontrol that will eventually populate a small pixel based map on the homepage of a site. Each populated pixel will will have a jQuery hover effect that will display some text information and 2 images.
In the Umbraco back office I am using DAMP for the mulitple images selection so my current XML structure is:
var specificNode = new Node(1158); var childNodes = specificNode.Children;
foreach (Node childNode in childNodes) { foreach (Property property in childNode.Properties) {
} }
The second foreach loop manages to get as far down as "propertyImage1", but no further. I've tried and tried to get down into the DAMP nodes and beyond but it's not working.
The `DAMP` node has child nodes which won't be considered children of the `AProject` node. If you refactored your loops into a recursive function you could carry on through the depths of other nodes, though. Such as...
void IterateChildren(Node node) { foreach (Node child in node.Children) { foreach (Property property in child.Properties) { //do something with the properties of this node } //do this over again for the children node IterateChildren(child); } }
It's likely you actually want to return something, which would entail tailoring this to your needs, obviously.
Getting all child and grandchild nodes using DAMP
Hi all,
I'm trying to create a usercontrol that will eventually populate a small pixel based map on the homepage of a site. Each populated pixel will will have a jQuery hover effect that will display some text information and 2 images.
In the Umbraco back office I am using DAMP for the mulitple images selection so my current XML structure is:
The code I have is:
The second foreach loop manages to get as far down as "propertyImage1", but no further. I've tried and tried to get down into the DAMP nodes and beyond but it's not working.
I'm using Umbraco 4.7.1.
Any help or advice would be great.
Thanks.
The `DAMP` node has child nodes which won't be considered children of the `AProject` node. If you refactored your loops into a recursive function you could carry on through the depths of other nodes, though. Such as...
It's likely you actually want to return something, which would entail tailoring this to your needs, obviously.
In XSLT:
is working on a reply...