Editors
Configuring the editor of a collection in Umbraco UI Builder, the backoffice UI builder for Umbraco.
An editor is the user interface used to edit an entity and is made up of tabs and property editors.
Configuring an editor
The editor configuration is a sub-configuration of a Collection
config builder instance and is accessed via its Editor
method.
Editor(Lambda editorConfig = null) : EditorConfig<TEntityType>
Accesses the editor config of the given collection.
Adding a tab to an editor
AddTab(string name, Lambda tabConfig = null) : EditorTabConfigBuilder<TEntityType>
Adds a tab to the editor.
Configuring a sidebar to a tab
A slidebar is a smaller area that is displayed to the right of the main editor. The sidebar can also contain fieldsets and fields in the same way tabs can. However, it is a much more limited display area so you'll need to choose your field types carefully. The sidebar is a great location to display entity metadata.
Sidebar(Lambda sidebarConfig = null) : EditorTabSidebarConfigBuilder<TEntityType>
Configures the sidebar for the tab.
Setting the visibility of a tab
SetVisibility(Predicate<EditorTabVisibilityContext> visibilityExpression) : EditorTabConfigBuilder<TEntityType>
Sets the runtime visibility of the tab.
Adding a fieldset to a tab
AddFieldset(string name, Lambda fieldsetConfig = null) : EditorFieldsetConfigBuilder<TEntityType>
Adds the given fieldset to the tab.
Setting the visibility of a fieldset
SetVisibility(Predicate<EditorFieldsetVisibilityContext> visibilityExpression) : EditorFieldsetConfigBuilder<TEntityType>
Sets the runtime visibility of the fieldset.
Adding a field to a fieldset
AddField(Lambda propertyExpression, Lambda propertyConfig = null) : EditorFieldConfigBuilder<TEntityType, TValueType>
Adds the given property to the editor.
Changing the label of a field
By default, Umbraco UI Builder will build the label from the property name, including splitting camel case names into sentence cases. However, you can set an explicit label if preferred.
SetLabel(string label) : EditorFieldConfigBuilder<TEntityType, TValueType>
Sets the label for the editor field.
Hiding the label of a field
Sometimes you may have a field editor that would work better in full width. You can achieve this by explicitly hiding the field label.
HideLabel() : EditorFieldConfigBuilder<TEntityType, TValueType>
Hides the label for the editor field.
Adding a description to a field
SetDescription(string description) : EditorFieldConfigBuilder<TEntityType, TValueType>
Sets the description for the editor field.
Changing the Data Type of a field
By default, Umbraco UI Builder will automatically choose a relevant Data Type for basic field types. However, if you wish to use an alternative Data Type then you can override this.
SetDataType(string dataTypeName) : EditorFieldConfigBuilder<TEntityType, TValueType>
Set the Data Type of the current field to the Umbraco Data Type with the given name.
SetDataType(int dataTypeId) : EditorFieldConfigBuilder<TEntityType, TValueType>
Set the Data Type of the current field to the Umbraco Data Type with the given id.
Setting the default value of a field
SetDefaultValue(TValueType defaultValue) : EditorFieldConfigBuilder<TEntityType, TValueType>
Sets the default value to a known constant.
SetDefaultValue(Func defaultValueFunc) : EditorFieldConfigBuilder<TEntityType, TValueType>
Sets the default value via a function that gets evaluated at time of entity creation.
Making a field required
MakeRequired() : EditorFieldConfigBuilder<TEntityType, TValueType>
Makes the given field required.
Validating a field
SetValidationRegex(string regex) : EditorFieldConfigBuilder<TEntityType, TValueType>
Defines the regular expression to use when validating the field.
Making a field read-only
MakeReadOnly() : EditorFieldConfigBuilder<TEntityType, TValueType>
Makes the current field read-only disabling editing in the UI.
MakeReadOnly(Func<TValueType, string> format) : EditorFieldConfigBuilder<TEntityType, TValueType>
Makes the current field read-only disabling editing in the UI. Provides a custom formatting expression to use when rendering the value as a string.
MakeReadOnly(object dataTypeNameOrId) : EditorFieldConfigBuilder<TEntityType, TValueType>
Makes the current field read-only disabling editing in the UI. Provides the name or id of a datatype to use when in read-only mode.
MakeReadOnly(Predicate<EditorFieldReadOnlyContext> readOnlyExp) : EditorFieldConfigBuilder<TEntityType, TValueType>
Makes the current field read-only disabling editing in the UI if the given runtime predicate is true.
MakeReadOnly(Predicate<EditorFieldReadOnlyContext> readOnlyExp, Func<TValueType, string> format) : EditorFieldConfigBuilder<TEntityType, TValueType>
Makes the current field read-only disabling editing in the UI if the given runtime predicate is true. Provides a custom formatting expression to use when rendering the value as a string.
MakeReadOnly(Predicate<EditorFieldReadOnlyContext> readOnlyExp, object dataTypeNameOrId) : EditorFieldConfigBuilder<TEntityType, TValueType>
Makes the current field read-only disabling editing in the UI if the given runtime predicate is true. Provides the name or id of a datatype to use when in read-only mode.
Setting the visibility of a field
SetVisibility(Predicate<EditorFieldVisibilityContext> visibilityExpression) : EditorFieldConfigBuilder<TEntityType, TValueType>
Sets the runtime visibility of the field.
Last updated