From f368b493dedd03da8db3b3950d2a0e2c33c14659 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Fri, 7 Sep 2018 15:02:44 +0100 Subject: [PATCH] Updates Content Controller - that uses the Mapping AfterMap to allow us to update the Name of the node based on the culturename passed into the WebAPI --- src/Umbraco.Web/Editors/ContentController.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index 09126b80ee..af79e04f2b 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -456,7 +456,8 @@ namespace Umbraco.Web.Editors string orderBy = "SortOrder", Direction orderDirection = Direction.Ascending, bool orderBySystemField = true, - string filter = "") + string filter = "", + string cultureName = "") { long totalChildren; IContent[] children; @@ -493,6 +494,11 @@ namespace Umbraco.Web.Editors Mapper.Map>(content, opts => { + if(string.IsNullOrEmpty(cultureName) == false) + { + opts.AfterMap((source, target) => target.Name = source.GetCultureName(cultureName)); + } + // if there's a list of property aliases to map - we will make sure to store this in the mapping context. if (String.IsNullOrWhiteSpace(includeProperties) == false) { @@ -500,6 +506,7 @@ namespace Umbraco.Web.Editors } })); + return pagedResult; }