Hi,
I currently have a content node which has a child, which also has a child. What I'm trying to get my head around is how to get the value of the media picker from the last child.
e.g.
To try and help explain, I need to get an image url from the Green node in this tab list.
So, foreach item gets the blue node information, then I need to get the image and any other information from the green node.
foreach(var node in nodes) //the blue guys
{
foreach (var subnode in node.children) //the green guys
{
if(subnode.PropertyHasValue("image")
{
do something with it
}
}
}
Hi Dave,
Thanks but the If (subnode) always returns null.
I think it's pretty close, if I debug and hover over subnode, I can see "Properties: Count = 6"
If I expand this in debug, I can see [0], [1], [2]...
If I expand [3] then I can see the property value "image". I just can't seem to get there to pull out the info.
I tried if
If(subnode.Properties[i]...
But that doesn't work. I didn't expect this to be so troublesome!
Edit:
So, child.Properties gets me the count of 6, which is the number of items I have on the last tab, but I just need to now search those 6 items to find the PropertTypeAlias.
if (child.Properties.PropertyHasValue("tabsImage"))
{
var test = "test";
}
This code gives the error: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: ''System.Collections.Generic.Dictionary
If a child node has a child node, return value
Hi, I currently have a content node which has a child, which also has a child. What I'm trying to get my head around is how to get the value of the media picker from the last child. e.g.
I need to get the image url from the child.
Just now I have
But I think I need to do something like
is that doable?
To try and help explain, I need to get an image url from the Green node in this tab list. So, foreach item gets the blue node information, then I need to get the image and any other information from the green node.
Hey Owain,
if it's what I think it is...
Hi Dave, Thanks but the If (subnode) always returns null.
I think it's pretty close, if I debug and hover over subnode, I can see "Properties: Count = 6" If I expand this in debug, I can see [0], [1], [2]...
If I expand [3] then I can see the property value "image". I just can't seem to get there to pull out the info.
I tried if
But that doesn't work. I didn't expect this to be so troublesome!
Edit:
So, child.Properties gets me the count of 6, which is the number of items I have on the last tab, but I just need to now search those 6 items to find the PropertTypeAlias.
This code gives the error: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: ''System.Collections.Generic.Dictionary
is working on a reply...