Fixes template drop down data and persisting an updated template.

This commit is contained in:
Shannon
2013-09-05 15:14:28 +10:00
parent 0026f7bd01
commit e4cb079ae1
4 changed files with 17 additions and 23 deletions

View File

@@ -88,8 +88,11 @@ namespace Umbraco.Web.Models.Mapping
private static void MapGenericCustomProperties(IContent content, ContentItemDisplay display)
{
//fill in the template config to be passed to the template drop down.
var templateItemConfig = new List<AllowedTemplate> {new AllowedTemplate {Alias = "", Name = "Choose..."}};
templateItemConfig.AddRange(content.ContentType.AllowedTemplates.Select(t => new AllowedTemplate {Alias = t.Alias, Name = t.Name}));
var templateItemConfig = new Dictionary<string, string> {{"", "Choose..."}};
foreach (var t in content.ContentType.AllowedTemplates)
{
templateItemConfig.Add(t.Alias, t.Name);
}
TabsAndPropertiesResolver.MapGenericProperties(
content, display,
@@ -127,15 +130,6 @@ namespace Umbraco.Web.Models.Mapping
});
}
[DataContract(Name = "template", Namespace = "")]
private class AllowedTemplate
{
[DataMember(Name = "alias")]
public string Alias { get; set; }
[DataMember(Name = "name")]
public string Name { get; set; }
}
/// <summary>
/// Gets the published date value for the IContent object
/// </summary>