public override void UpdateFieldSettings(string fieldType, string fieldName, SettingsDictionary settingsDictionary, IUpdateModel updateModel) { if (fieldType != "PhoneField") { return; } var model = new PhoneFieldSettings(); if (updateModel.TryUpdateModel(model, "PhoneFieldSettings", null, null)) { UpdateSettings(model, settingsDictionary, "PhoneFieldSettings"); settingsDictionary["PhoneFieldSettings.DefaultValue"] = model.DefaultValue; } }
public override IEnumerable<TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) { if (builder.FieldType != "PhoneField") { yield break; } var model = new PhoneFieldSettings(); if (updateModel.TryUpdateModel(model, "PhoneFieldSettings", null, null)) { UpdateSettings(model, builder, "PhoneFieldSettings"); builder.WithSetting("PhoneFieldSettings.DefaultValue", model.DefaultValue); } yield return DefinitionTemplate(model); }