I don't want to use a "visible" field to hide the Years and Months Folders and I don't want to filter on specific nodeTypeAlias. I want to use a generic code so it can be reused also for other tree with same or similar structure but different documentType (for example events, products, etc.).
Hi Owen, thank you for your answer. I tried your code but I receive this error: "error CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type"
How to get last nodes of a news tree with Razor?
Hi to all,
I have this tree node structure:
News
|
Year Folder
|
Month Month
|
News Page 1
News Page 2
News Page 3
I want to get all News Pages nodes without the Year and the Month Folders.
In XLST I used this code to get only the "last" nodes:
How can I do that with Razor?
I don't want to use a "visible" field to hide the Years and Months Folders and I don't want to filter on specific nodeTypeAlias.
I want to use a generic code so it can be reused also for other tree with same or similar structure but different documentType (for example events, products, etc.).
Thank you in advance
Adriano
Hi Owen,
thank you for your answer.
I tried your code but I receive this error:
"error CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type"
Adriano
I solved...I need to convert DynamicNode in DynamicNodeList to use it in my code. :-)
Best Reguards
Adriano
Hi Owen,
I checked the result but the code function partially.
When I print the nodes, I don't see the Years Folders (correct) but I see the News Pages and also the Months Folders (wrong)
I need to print only the News Pages (last nodes) but I wish it were only seen the news.
Adriano
is working on a reply...