public override IEnumerable<TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) {
            if (builder.FieldType != "ContentPickerField") {
                yield break;
            }

            var model = new ContentPickerSearchFieldSettings();
            if (updateModel.TryUpdateModel(model, "ContentPickerSearchFieldSettings", null, null)) {
                builder.WithSetting("ContentPickerSearchFieldSettings.ShowSearchTab", model.ShowSearchTab.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("ContentPickerSearchFieldSettings.SearchIndex", model.SearchIndex);
                builder.WithSetting("ContentPickerSearchFieldSettings.DisplayedContentTypes", model.DisplayedContentTypes);
            }

            yield return DefinitionTemplate(model);
        }
示例#2
0
        public override IEnumerable <TemplateViewModel> PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel)
        {
            if (builder.FieldType != "ContentPickerField")
            {
                yield break;
            }

            var model = new ContentPickerSearchFieldSettings();

            if (updateModel.TryUpdateModel(model, "ContentPickerSearchFieldSettings", null, null))
            {
                builder.WithSetting("ContentPickerSearchFieldSettings.ShowSearchTab", model.ShowSearchTab.ToString(CultureInfo.InvariantCulture));
                builder.WithSetting("ContentPickerSearchFieldSettings.SearchIndex", model.SearchIndex);
                builder.WithSetting("ContentPickerSearchFieldSettings.DisplayedContentTypes", model.DisplayedContentTypes);
            }

            yield return(DefinitionTemplate(model));
        }