I am currently expanding a site in which I need to store multiple webbinar entries under a page so that they can be rendered on the site.
I can read how many nodes are the decendants of the page, but I am struggling with pulling their data into variables e.g. image (videothumbnail), title and tags.
var videoParentNode = Umbraco.TypedContent(2218);
var videoChildren = videoParentNode.Descendants().Where(x => x.Level == 4);
foreach(var index in videoChildren){
var videoThumbnail = videoChildren.GetPropertyValue("VideoThumbnail");
}
Currently the line giving me issues is the one inside the foreach statement. What could be the issue? This is the error message I am getting:
CS1928: 'System.Collections.Generic.IEnumerable
Unable to store content node data in variables
Hello,
I am currently expanding a site in which I need to store multiple webbinar entries under a page so that they can be rendered on the site. I can read how many nodes are the decendants of the page, but I am struggling with pulling their data into variables e.g. image (videothumbnail), title and tags.
Currently the line giving me issues is the one inside the foreach statement. What could be the issue? This is the error message I am getting: CS1928: 'System.Collections.Generic.IEnumerable
Hi Emanuel,
Inside the loop I think you want to use the index variable instead of the collection you're iterating through? E.g.:
Hope that helps,
Chriztian
is working on a reply...