75
75
- [ ` editField(id[, opts]) ` : [ Field] ( #field )] ( #editfieldid-opts--fieldfield )
76
76
- [ ` deleteField(id) ` : void] ( #deletefieldid--void )
77
77
- [ ` changeFieldId (currentId, newId) ` : void] ( #changefieldid-currentid-newid--void )
78
- - [ ` changeEditorInterface (fieldId, widgetId[, settings]) ` : void] ( #changeeditorinterface-fieldid-widgetid-settings--void )
79
- - [ ` resetEditorInterface (fieldId) ` : void] ( #reseteditorinterface-fieldid--void )
80
- - [ ` copyEditorInterface (sourceFieldId, destinationFieldId) ` : void] ( #copyeditorinterface-sourcefieldid-destinationfieldid--void )
78
+ - [ ` changeFieldControl (fieldId, widgetNamespace, widgetId[, settings]) ` : void] ( #changefieldcontrol-fieldid-widgetid-widgetnamespace-settings--void )
79
+ - [ ` resetFieldControl (fieldId) ` : void] ( #resetfieldcontrol-fieldid--void )
80
+ - [ ` copyFieldControl (sourceFieldId, destinationFieldId) ` : void] ( #copyfieldcontrol-sourcefieldid-destinationfieldid--void )
81
+ - [ ` addSidebarWidget (widgetNamespace, widgetId[, settings, insertBeforeWidgetId]) ` : void] ( #addsidebarwidget-widgetnamespace-widgetid-settings-insertbeforewidgetid--void )
82
+ - [ ` updateSidebarWidget (widgetNamespace, widgetId, settings) ` : void] ( #updatesidebarwidget-widgetnamespace-widgetid-settings--void )
83
+ - [ ` removeSidebarWidget (widgetNamespace, widgetId) ` : void] ( #removesidebarwidget-widgetnamespace-widgetid--void )
84
+ - [ ` resetSidebarToDefault () ` : void] ( #resetsidebartodefault---void )
85
+ - [ ` configureEntryEditor (widgetNamespace, widgetId[, settings]) ` : void] ( #configureentryeditor-widgetid-widgetnamespace-settings--void )
86
+ - [ ` resetEditorToDefault() ` : void] ( #reseteditortodefault---void )
81
87
- [ Field] ( #field )
82
88
- [ Validation errors] ( #validation-errors )
83
89
- [ Example migrations] ( #example-migrations )
107
113
- Edit a field
108
114
- Delete a field
109
115
- Rename a field
110
- - Change editorInterface
111
- - Reset editorInterface
112
- - Copy editorInterface
116
+ - Change a field's control
117
+ - Reset a field's control
118
+ - Copy a field's control
113
119
- Move field
114
120
115
121
## Pre-requisites && Installation
@@ -517,15 +523,19 @@ module.exports = function (migration) {
517
523
};
518
524
```
519
525
520
- #### ` changeEditorInterface (fieldId, widgetId[, settings])` : void
526
+ #### ` changeFieldControl (fieldId, widgetNamespace , widgetId[, settings])` : void
521
527
522
- Changes the editor interface of given field's ID.
528
+ Changes control interface of given field's ID.
523
529
524
530
** ` fieldId : string ` ** – The ID of the field.
525
531
532
+ ** ` widgetNamespace : string ` ** – The namespace of the widget, one of the following values:
533
+ - ` builtin ` (Standard widget)
534
+ - ` extension ` (Custom UI extension)
535
+
526
536
** ` widgetId : string ` ** – The new widget ID for the field. See the [ editor interface documentation] ( https://www.contentful.com/developers/docs/concepts/editor-interfaces/ ) for a list of available widgets.
527
537
528
- ** ` settings : Object ` ** – Widget settings, with the following options:
538
+ ** ` settings : Object ` ** – Widget settings and extension instance parameters. Key-value pairs of type (string, number | boolean | string). For builtin widgets, the the following options are available :
529
539
530
540
- ** ` helpText : string ` ** – This help text will show up below the field.
531
541
- ** ` trueLabel : string ` ** _ (only for fields of type boolean)_ – Shows this text next to the radio button that sets this value to ` true ` . Defaults to “Yes”.
@@ -535,14 +545,66 @@ Changes the editor interface of given field's ID.
535
545
- ** ` ampm : string ` ** _ (only for fields of type datePicker)_ – Specifies which type of clock to use. Must be one of the strings “12” or “24” (default).
536
546
- ** ` bulkEditing : boolean ` ** _ (only for fields of type Array)_ – Specifies whether bulk editing of linked entries is possible.
537
547
538
- #### ` resetEditorInterface (fieldId)` : void
548
+ #### ` resetFieldControl (fieldId)` : void
539
549
540
550
** ` fieldId : string ` ** – The ID of the field.
541
551
542
- #### ` copyEditorInterface (sourceFieldId, destinationFieldId) ` : void
552
+ #### ` copyFieldControl (sourceFieldId, destinationFieldId) ` : void
553
+
554
+ ** ` sourceFieldId : string ` ** – The ID of the field to copy the control setting from.
555
+ ** ` destinationFieldId : string ` ** – The ID of the field to apply the copied control setting to.
556
+
557
+ #### ` addSidebarWidget (widgetNamespace, widgetId[, settings, insertBeforeWidgetId]) ` : void
558
+
559
+ Adds a builtin or custom widget to the sidebar of the content type.
560
+
561
+ ** ` widgetNamespace: string ` ** – The namespace of the widget, one of the following values:
562
+ - ` sidebar-builtin ` (Standard widget, default)
563
+ - ` extension ` (Custom UI extension)
564
+
565
+ ** ` widgetId : string ` ** – The ID of the builtin or extension widget to add.
566
+
567
+ ** ` settings : Object ` ** – Instance settings for the widget. Key-value pairs of type (string, number | boolean | string)
568
+
569
+ ** ` insertBeforeWidgetId : Object ` ** – Insert widget above this widget in the sidebar. If null, the widget will be added to the end.
570
+
571
+ #### ` updateSidebarWidget (widgetNamespace, widgetId, settings) ` : void
572
+
573
+ Updates the configuration of a widget in the sidebar of the content type.
574
+
575
+ ** ` widgetNamespace: string ` ** – The namespace of the widget, one of the following values:
576
+ - ` sidebar-builtin ` (Standard widget, default)
577
+ - ` extension ` (Custom UI extension)
578
+
579
+ ** ` widgetId : string ` ** – The ID of the builtin or extension widget to add.
580
+
581
+ ** ` settings : Object ` ** – Instance settings for the widget. Key-value pairs of type (string, number | boolean | string)
582
+
583
+ #### ` removeSidebarWidget (widgetNamespace, widgetId) ` : void
584
+
585
+ Removes a widget from the sidebar of the content type.
586
+
587
+ ** ` widgetNamespace: string ` ** – The namespace of the widget, one of the following values:
588
+ - ` sidebar-builtin ` (Standard widget, default)
589
+ - ` extension ` (Custom UI extension)
590
+
591
+ ** ` widgetId : string ` ** – The ID of the builtin or extension widget to remove.
592
+
593
+ #### ` resetSidebarToDefault () ` : void
594
+
595
+ Resets the sidebar of the content type to default.
596
+
597
+ #### ` configureEntryEditor (widgetNamespace, widgetId[, settings]) ` : void
598
+
599
+ Sets the entry editor to specified widget.
600
+
601
+ ** ` widgetNamespace: string ` ** – The namespace of the widget.
602
+ ** ` widgetId : string ` ** – The ID of the builtin or extension widget to add.
603
+ ** ` settings : Object ` ** – Instance settings for the widget. Key-value pairs of type (string, number | boolean | string). Optional.
604
+
605
+ #### ` resetEntryEditorToDefault () ` : void
543
606
544
- ** ` sourceFieldId : string ` ** – The ID of the field to copy the editorinterface setting from.
545
- ** ` destinationFieldId : string ` ** – The ID of the field to apply the copied editorinterface setting to.
607
+ Resets the entry editor of the content type to default.
546
608
547
609
### Field
548
610
0 commit comments