I want to list the selected nodes if they are defined on the currentPage or one of it ancestors.
@foreach(var id in CurrentPage.AncestorOrSelf(2).footerLinks.Split(','))
{
var content = Umbraco.Content(id);
<a href="@content.Url" class="footerlink">@content.Name</a>
}
But it doenst really work. It seems like it goes all the way to level 2 and takes the defined "footerlinks" from there. Even if they are defines on CurrentPage?
@foreach(var id in CurrentPage._footerLinks.Split(',')) { var content = Umbraco.Content(id); <a href="@content.Url" class="footerlink">@content.Name</a> }
AncestorOrSelf()... How to use correctly?
I have a multi node tree picker in my footer.
I want to list the selected nodes if they are defined on the currentPage or one of it ancestors.
But it doenst really work. It seems like it goes all the way to level 2 and takes the defined "footerlinks" from there. Even if they are defines on CurrentPage?
Any pointers on how to do this correctly?
Hi Claus,
What if you are doing it like this
Hope this helps,
/Dennis
Yup, that looks like it does the trick :), Thanks
is working on a reply...