Adds contentype alias to media and cotnent tree nodes

This commit is contained in:
perploug
2013-10-27 14:12:27 +01:00
parent d86654fa6b
commit ab36687c85
3 changed files with 32 additions and 6 deletions

View File

@@ -50,13 +50,16 @@ namespace Umbraco.Web.Trees
protected override TreeNodeCollection PerformGetTreeNodes(string id, FormDataCollection queryStrings)
{
var entities = GetChildEntities(id);
var nodes = new TreeNodeCollection();
var nodes = new TreeNodeCollection();
nodes.AddRange(
entities.Cast<UmbracoEntity>()
.Select(e => CreateTreeNode(e.Id.ToInvariantString(), queryStrings, e.Name, e.ContentTypeIcon, e.HasChildren)));
foreach (var entity in entities)
{
var e = (UmbracoEntity)entity;
var node = CreateTreeNode(e.Id.ToInvariantString(), queryStrings, e.Name, e.ContentTypeIcon, e.HasChildren);
node.AdditionalData.Add("contentType", e.ContentTypeAlias);
nodes.Add(node);
}
return nodes;
}