I am using the Multinode Treepicker to choose which items to show and that works fine but how do I get the name and url on the item's parent (marked with green below).
I am using this standard code which works fine, but I also need to show the name and url for the item parent:
@{ var bannerList = CurrentPage.banner.ToString().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
var bannerCollection = Umbraco.Content(bannerList); foreach (var item in bannerCollection) { @item.Name } }
I think that you could do something like this to achieve what you want. First I think you need to find the data node, and from there loop though the children, and pick only the cast and series document type.
@{ var dataItem = Umbraco.ContentAtRoot().DescendantsOrSelf("DataDocumentTypeAlias").FirstOrDefault(); } <ul> @* OrderBy() takes the property to sort by and optionally order desc/asc *@
Remember to change the document type alias so it match your case.
Hope this works, or at least give your some idea on how you could do it. If you have other questions about this don't hesitate to ask again, and I will try to help,
Get parent Url and Name Multinode Treepicker
Hi,
I am using the Multinode Treepicker to choose which items to show and that works fine but how do I get the name and url on the item's parent (marked with green below).
I am using this standard code which works fine, but I also need to show the name and url for the item parent:
Thanks in advance!
// René
Hi René
I think that you could do something like this to achieve what you want. First I think you need to find the data node, and from there loop though the children, and pick only the cast and series document type.
Remember to change the document type alias so it match your case.
Hope this works, or at least give your some idea on how you could do it. If you have other questions about this don't hesitate to ask again, and I will try to help,
/Dennis
Hi Dennis
That was just what I was looking for.
Now I am using your code and just added:
Thanks!
// René
Hi René
You're welcome, glad that I could help you to find a solution.
/Dennis
is working on a reply...