v5: How to loop over children on a selected node in a content picker
Hi guys
Let's say I have a list of nodes on a doument type of mine. This list just renders the cildren of the current node using:
foreach (var node in DynamicModel.Children)
This is pretty simple.
But on the same document type, I've got a content picker(with an alias of sourceTree). If there's selected a node in this content picker I want to list all children of the selected node. I can't make this work, but I guess I have to do some stuff like the following:
@{ dynamic startNode = DynamicModel;
if(DynamicModel.SourceTree != ""){ //Is this the best way of making sure that a node is selected in the content picker? startNode = //What to do here? } foreach (var node in startNode.Children){ //I'll do some stuff here. No problems inside the loop. } }
v5: How to loop over children on a selected node in a content picker
Hi guys
Let's say I have a list of nodes on a doument type of mine. This list just renders the cildren of the current node using:
This is pretty simple.
But on the same document type, I've got a content picker(with an alias of sourceTree). If there's selected a node in this content picker I want to list all children of the selected node. I can't make this work, but I guess I have to do some stuff like the following:
Anyone have some inputs to this?
Thanks in advance :)
/Kim A
is working on a reply...