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
Topic author was deleted
What's the best way of getting an ancestor of a specific level (say for a second level nav, listing all children of the second level parent) ?
Anyone got an idea?
Something like this should work:
@Model.Ancestors().Where("Level == 2")
Comment author was deleted
Yeah thought so but can't make it work getting an error
Value cannot be null. Parameter name: expression
weird, that works fine for me. Does @Model.Level work though? You could have a look after setting a breakpoint, maybe the stacktrace is a little more informative.
Both Ancestor(s) and Descendant(s) have level/nodetype filters now so this would work:
- @Model.AncestorOrSelf(2) (get the ancestor (or model self) at the level of 2)
- @Model.AncestorOrSelf("umbHomepage") is also kind of cool (translates into get the ancestor (or model self) which has the nodetype alias of 'umbHomepage')
4.7RC didn't handle property lookups (not document properties but actual getters defined on the DynamicNode) properly
Fixed in 4.7
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted