Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to group descendants of home node.
I tried
var pages = home.Descendants("TextPage").Where("!Disabled").GroupBy("type")
and this returns type Umbraco.Web.Dynamics.DynamicGrouping
Umbraco.Web.Dynamics.DynamicGrouping
and if I try to loop trough nodes
@foreach (var page in pages) { @(attraction.GetValue("type"))<br /> }
I'm getting error saying
'object' does not contain a definition for 'GetValue'
GetPropertyValue does not work either
GetPropertyValue
This does not work either:
var pages = home.Descendants("TextPage").Items.Where(x => x.GetPropertyValue<string>("type") == "something");
and throws:
Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type
var pages = home.Descendants("TextPage").Items.Count();
returns
'Umbraco.Web.Models.DynamicPublishedContentList.Items' is inaccessible due to its protection level
I've no idea what else to try and why it doesn't work as I saw many examples of groupby and made my stuff same way.
I tried frst in Macro partial then in template directly, both don't work :(
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
GroupBy not working for descendants
I'm trying to group descendants of home node.
I tried
and this returns type
Umbraco.Web.Dynamics.DynamicGrouping
and if I try to loop trough nodes
I'm getting error saying
'object' does not contain a definition for 'GetValue'
GetPropertyValue
does not work eitherThis does not work either:
and throws:
Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type
returns
'Umbraco.Web.Models.DynamicPublishedContentList.Items' is inaccessible due to its protection level
I've no idea what else to try and why it doesn't work as I saw many examples of groupby and made my stuff same way.
I tried frst in Macro partial then in template directly, both don't work :(
is working on a reply...