Search Results for

    Show / Hide Table of Contents
    View Source

    Class RichTextPropertyEditor

    Represents a rich text property editor.

    Inheritance
    object
    DataEditor
    Namespace: Umbraco.Cms.Core.PropertyEditors
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    [DataEditor("Umbraco.RichText", ValueType = "TEXT", ValueEditorIsReusable = true)]
    public class RichTextPropertyEditor : DataEditor, IDataEditor, IDiscoverable, IValueSchemaProvider

    Constructors

    View Source

    RichTextPropertyEditor(IDataValueEditorFactory, IIOHelper, IRichTextPropertyIndexValueFactory)

    Initializes a new instance of the RichTextPropertyEditor class.

    Declaration
    public RichTextPropertyEditor(IDataValueEditorFactory dataValueEditorFactory, IIOHelper ioHelper, IRichTextPropertyIndexValueFactory richTextPropertyIndexValueFactory)
    Parameters
    Type Name Description
    IDataValueEditorFactory dataValueEditorFactory

    Factory used to create data value editors for property values.

    IIOHelper ioHelper

    Helper for IO operations, such as resolving file paths.

    IRichTextPropertyIndexValueFactory richTextPropertyIndexValueFactory

    Factory for creating index values specific to rich text properties.

    Remarks

    The constructor will set up the property editor based on the attribute if one is found.

    Properties

    View Source

    PropertyIndexValueFactory

    Gets the IPropertyIndexValueFactory instance used to generate index values for properties edited with the rich text property editor. This factory is used to extract and format property values for search indexing.

    Declaration
    public override IPropertyIndexValueFactory PropertyIndexValueFactory { get; }
    Property Value
    Type Description
    IPropertyIndexValueFactory
    View Source

    SupportsConfigurableElements

    Gets a value indicating whether this property editor supports configurable elements. Always returns true for the rich text property editor.

    Declaration
    public override bool SupportsConfigurableElements { get; }
    Property Value
    Type Description
    bool

    Methods

    View Source

    CanMergePartialPropertyValues(IPropertyType)

    Determines if the value editor needs to perform MergePartialPropertyValueForCulture(object?, object?, string?) for a given property type.

    Declaration
    public override bool CanMergePartialPropertyValues(IPropertyType propertyType)
    Parameters
    Type Name Description
    IPropertyType propertyType
    Returns
    Type Description
    bool
    View Source

    CreateConfigurationEditor()

    Creates a configuration editor instance.

    Declaration
    protected override IConfigurationEditor CreateConfigurationEditor()
    Returns
    Type Description
    IConfigurationEditor
    View Source

    CreateValueEditor()

    Create a custom value editor

    Declaration
    protected override IDataValueEditor CreateValueEditor()
    Returns
    Type Description
    IDataValueEditor
    View Source

    GetValueSchema(object?)

    Gets a JSON Schema (draft 2020-12) describing the incoming value structure.

    Declaration
    public JsonObject? GetValueSchema(object? configuration)
    Parameters
    Type Name Description
    object configuration

    The data type configuration, which may affect the schema.

    Returns
    Type Description
    JsonObject

    A System.Text.Json.Nodes.JsonObject containing a valid JSON Schema, or null if the schema cannot be generated for the given configuration.

    Remarks

    The returned schema should describe the structure that IDataValueEditor.FromEditor receives (i.e., what the Management API accepts).

    For configuration-dependent schemas (e.g., BlockList with specific element types), the schema should reflect the constraints defined in the configuration.

    View Source

    GetValueType(object?)

    Gets the CLR type that represents the incoming value structure.

    Declaration
    public Type? GetValueType(object? configuration)
    Parameters
    Type Name Description
    object configuration

    The data type configuration, which may affect the value type.

    Returns
    Type Description
    Type

    The CLR type of the incoming value, or null if the type cannot be determined or varies significantly based on configuration.

    Remarks

    For simple editors (e.g., textbox), this might return string. For complex editors (e.g., MediaPicker3), this returns the DTO type that the editor submits. For block-based editors where the structure is entirely configuration-dependent, this may return null.

    View Source

    MergePartialPropertyValueForCulture(object?, object?, string?)

    Partially merges a source property value into a target property value for a given culture.

    Declaration
    public override object? MergePartialPropertyValueForCulture(object? sourceValue, object? targetValue, string? culture)
    Parameters
    Type Name Description
    object sourceValue

    The source property value.

    object targetValue

    The target property value.

    string culture

    The culture (or null for invariant).

    Returns
    Type Description
    object

    The result of the merge operation.

    View Source

    MergeVariantInvariantPropertyValue(object?, object?, bool, HashSet<string>)

    Merges the variant and invariant property values based on the specified parameters.

    Declaration
    public override object? MergeVariantInvariantPropertyValue(object? sourceValue, object? targetValue, bool canUpdateInvariantData, HashSet<string> allowedCultures)
    Parameters
    Type Name Description
    object sourceValue

    The source value to merge from.

    object targetValue

    The target value to merge into.

    bool canUpdateInvariantData

    Indicates whether the invariant data can be updated.

    HashSet<string> allowedCultures

    A set of cultures allowed for the merge operation.

    Returns
    Type Description
    object

    The merged property value.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX