From 1e6d50a86ba904cdccbe7232e31c3ec5d7015727 Mon Sep 17 00:00:00 2001 From: srmooney Date: Thu, 6 Jul 2017 10:50:19 -0400 Subject: [PATCH] Add option for Listview to change the tab name --- .../Models/Mapping/TabsAndPropertiesResolver.cs | 7 ++++++- src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs b/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs index 0671f59273..930e420374 100644 --- a/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs @@ -170,7 +170,12 @@ namespace Umbraco.Web.Models.Mapping var listViewConfig = editor.PreValueEditor.ConvertDbToEditor(editor.DefaultPreValues, preVals); //add the entity type to the config - listViewConfig["entityType"] = entityType; + listViewConfig["entityType"] = entityType; + + //Override Tab Label if tabName is provided + if (listViewConfig.ContainsKey("tabName") && !String.IsNullOrWhiteSpace(listViewConfig["tabName"].ToString())) { + listViewTab.Label = listViewConfig["tabName"].ToString(); + } var listViewProperties = new List(); listViewProperties.Add(new ContentPropertyDisplay diff --git a/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs index f744e4d807..9d897501b1 100644 --- a/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs @@ -50,7 +50,10 @@ namespace Umbraco.Web.PropertyEditors } internal class ListViewPreValueEditor : PreValueEditor - { + { + [PreValueField("tabName", "Tab Name", "textstring", Description = "The name of the tab that the list of child items will be displayed")] + public int TabName { get; set; } + [PreValueField("displayAtTabNumber", "Display At Tab Number", "number", Description = "Which tab position that the list of child items will be displayed")] public int DisplayAtTabNumber { get; set; }