Menahem Gil
Menahem Gil

Reputation: 829

Migrating Umbraco 7 website to 11: filter items in a node

I try to migrate my website from Umbraco 7 to 11

I have the following code on 7:

var Section_node = Umbraco.Content(1234);    

var Section_pages = @Section_node.Children.Where("Visible");
Section_pages = Section_node.DescendantsOrSelf().Where("NodeTypeAlias == @0", "blogPosts");

So I try to convert it to 11 (.net 7) as follow:

var Section_node = Umbraco.Content(1234);    

var Section_pages = Section_node.Children.Where(x => x.IsVisible());
Section_pages = Section_node.DescendantsOrSelf().Where(NodeTypeAlias("@0")).And().Field("NewsPage");

But I'm still getting errors - any idea ?

Thanks.

Upvotes: 0

Views: 101

Answers (0)

Related Questions