I think you have only a few minor issues with having an @{ already inside the code block and that your second loop was iterating the list not the collection.
Try this:
@{
var tabList = CurrentPage.tabPickeR.ToString().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
var tabListCollection = Umbraco.Content(tabList);
foreach (var item in tabListCollection)
{
var portfolioList = item.portfolioItempicker.ToString().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
var portfolioListCollection = Umbraco.Content(portfolioList);
foreach (var portfolioItem in portfolioListCollection)
{
@portfolioItem.Name
}
}
}
There isn't anything wrong with this code specifically, I would suggest checking all of your property aliases to make sure they are exactly the same as you have in your document types including case. e.g. should "portfolioItempicker" be "portfolioItemPicker"?
Nested MultiNodeTreePicker
Hi There,
Anybody knows how can I use a MultiNodeTreePicker in another MultiNodeTreePicker?
My first trying:
Thanks for the help,
Levente
Hi Levente,
Welcome to Our!
I think you have only a few minor issues with having an @{ already inside the code block and that your second loop was iterating the list not the collection.
Try this:
Jeavon
Hi Jeavon,
Thank you for your help. Unfortunately still empty the second foreach.
Any idea?
Here is the full page code, maybe help a bit:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
<div class="tabs-container">
<div class=container>
<div class="row">
<div id="tabs" class="12u">
<ul>
@{
var tabList = CurrentPage.tabPickeR.ToString().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
var tabListCollection = Umbraco.Content(tabList);
foreach (var item in tabListCollection){
<li><a href="#@item.Id" title="">@item.Name<br/><span>@item.Description</span></a></li>
}
}
</ul>
<div id="tabs_container">
@{
foreach (var item in tabListCollection){
<div class="tab" id="@item.Id">
@{
var portfolioList = item.portfolioItempicker.ToString().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
var portfolioListCollection = Umbraco.Content(portfolioList);
foreach (var portfolioItem in portfolioListCollection)
{
<h3>Name goes here: @portfolioItem.Name</h3>
}
}
</div>
}
}
</div><!--End tabs container-->
</div><!--End tabs-->
</div>
</div>
</div>
There isn't anything wrong with this code specifically, I would suggest checking all of your property aliases to make sure they are exactly the same as you have in your document types including case. e.g. should "portfolioItempicker" be "portfolioItemPicker"?
Thank Jeavon,
Empty cache is my best friend.
Perfect! You should find that have a green tick on each of the above comments, clicking this on the correct answer will mark it as the solution.
is working on a reply...