Hi, I'm trying to select a group of nodes using a 'where' clause which evaluates a property value in the children of each node. That is to say it would select a group of parents which had at least one child node containing the specific value.
Not having any luck so far. Code is in a user control (VB in this case)
Thanks for any help - Steve
Dim ModelNodesForGrid = From n In New UmbracoHelper(UmbracoContext.Current).TypedContent(ModelOverviewNode.Id).Descendants.AsEnumerable()
Where n.DocumentTypeAlias = "Model" And n.Children.AsEnumerable().Where(n.GetPropertyValue("")) = ""
Select n
Order By n.SortOrder
obviously that's not working but is the idea
I want the "model" nodes where at least one of their children have a certain value (in this case flagged as 'active' with a true/false property)
thanks!
Dim ModelNodesForGrid =
From n In New UmbracoHelper(UmbracoContext.Current).TypedContent(ModelOverviewNode.Id).Descendants("Model")
Where n.Children.Any(Function(c As IPublishedContent) c.GetPropertyValue(Of Boolean)("Active") = True)
Select n
Order By n.SortOrder
Select Nodes by property value of child nodes
Hi, I'm trying to select a group of nodes using a 'where' clause which evaluates a property value in the children of each node. That is to say it would select a group of parents which had at least one child node containing the specific value. Not having any luck so far. Code is in a user control (VB in this case) Thanks for any help - Steve
Hi Steve,
i think you will have to show some code before anyone will be able to help you.
/René
Here's what I've got cooking:
obviously that's not working but is the idea I want the "model" nodes where at least one of their children have a certain value (in this case flagged as 'active' with a true/false property) thanks!
Hi Steve
I would usually write this in C#, but here goes :
Havent got any way of testing this, all the best.
Hi,
Just wondering if anyone had a chance to take a look or needed more code/description of the desired node selection.
Thanks, Steve
is working on a reply...