Adds in some logic if we have no child trees for that application/section then we create a SingleTreeRoot

This commit is contained in:
Warren Buckley
2018-12-11 14:09:44 +00:00
parent b0157d7116
commit 767cd93f08

View File

@@ -78,10 +78,20 @@ namespace Umbraco.Web.Trees
}
}
var multiTree = TreeRootNode.CreateMultiTreeRoot(collection);
multiTree.Name = Services.TextService.Localize("sections/" + application);
if(collection.Count > 0)
{
var multiTree = TreeRootNode.CreateMultiTreeRoot(collection);
multiTree.Name = Services.TextService.Localize("sections/" + application);
return multiTree;
return multiTree;
}
//Otherwise its a application/section with no trees (aka a full screen app)
//For example we do not have a Forms tree definied in C# & can not attribute with [Tree(isSingleNodeTree:true0]
var rootId = Constants.System.Root.ToString(CultureInfo.InvariantCulture);
var section = Services.TextService.Localize("sections/" + application);
return TreeRootNode.CreateSingleTreeRoot(rootId, null, null, section, TreeNodeCollection.Empty, true);
}
var rootNodeGroups = new List<TreeRootNode>();