diff --git a/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs b/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs
index 1d728c63a5..5c75bc07f7 100644
--- a/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs
+++ b/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs
@@ -109,6 +109,25 @@ namespace Umbraco.Web.Editors
var availableCompositions = Services.ContentTypeService.GetAvailableCompositeContentTypes(source, allContentTypes, filterContentTypes, filterPropertyTypes);
+ Func> getEntityContainers = contentType =>
+ {
+ if (contentType == null)
+ {
+ return null;
+ }
+ switch (type)
+ {
+ case UmbracoObjectTypes.DocumentType:
+ return Services.ContentTypeService.GetContentTypeContainers(contentType as IContentType);
+ case UmbracoObjectTypes.MediaType:
+ return Services.ContentTypeService.GetMediaTypeContainers(contentType as IMediaType);
+ case UmbracoObjectTypes.MemberType:
+ return new EntityContainer[0];
+ default:
+ throw new ArgumentOutOfRangeException("The entity type was not a content type");
+ }
+ };
+
var currCompositions = source == null ? new IContentTypeComposition[] { } : source.ContentTypeComposition.ToArray();
var compAliases = currCompositions.Select(x => x.Alias).ToArray();
var ancestors = availableCompositions.Ancestors.Select(x => x.Alias);
@@ -117,9 +136,6 @@ namespace Umbraco.Web.Editors
.Select(x => new Tuple(Mapper.Map(x.Composition), x.Allowed))
.Select(x =>
{
- //translate the name
- x.Item1.Name = TranslateItem(x.Item1.Name);
-
//we need to ensure that the item is enabled if it is already selected
// but do not allow it if it is any of the ancestors
if (compAliases.Contains(x.Item1.Alias) && ancestors.Contains(x.Item1.Alias) == false)
@@ -128,6 +144,14 @@ namespace Umbraco.Web.Editors
x = new Tuple(x.Item1, true);
}
+ //translate the name
+ x.Item1.Name = TranslateItem(x.Item1.Name);
+
+ var contentType = allContentTypes.FirstOrDefault(c => c.Key == x.Item1.Key);
+ var containers = getEntityContainers(contentType)?.ToArray();
+ var containerPath = $"/{(containers != null && containers.Any() ? $"{string.Join("/", containers.Select(c => c.Name))}/" : null)}";
+ x.Item1.AdditionalData["containerPath"] = containerPath;
+
return x;
})
.ToList();