I want to create a subnavigation macro partial for my publications
I could make it easy by this code:
var publicationcategories = Model.Content.Children;
but this wil only work on the Publications page. If on a publication category page, it will list the children nodes of that publicationcategory node, which is not what I want. I want to list the children of the Publications node, no matter where I am in the hierarchy.
So I tried something like this:
var categories = Model.Content.AncestorsOrSelf("PublicationArea").Children;
but the Children method is not recognized as a method of AncestorsOrSelf(string NodeType Alias)
Does anyone know how I can list the children of the Publications node, no matter where I am in the navigation hierarchy?
subnavigation issue in v6 Razor
Hi,
I want to create a subnavigation macro partial for my publications
I could make it easy by this code:
but this wil only work on the Publications page. If on a publication category page, it will list the children nodes of that publicationcategory node, which is not what I want. I want to list the children of the Publications node, no matter where I am in the hierarchy.
So I tried something like this:
but the Children method is not recognized as a method of AncestorsOrSelf(string NodeType Alias)
Does anyone know how I can list the children of the Publications node, no matter where I am in the navigation hierarchy?
Thanks for your help,
Anthony
Hi Anthony, just one character 's'
Try:
Jeavon
Hi Jeavon,
Thanks, it works! I was checking the Umbraco v6 MVC Razor Cheatsheets , there it references only the Collections method:
But
.AncestorOrSelf("PublicationArea").Children;
works.
Thanks a lot,
Anthony
Yes, I guess it along with the other single selector methods should be in the traversing section as it is on the old DynamicNode cheatsheet :-)
is working on a reply...