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