Search Results for

    Show / Hide Table of Contents
    View Source

    Class MultiUrlPickerValueEditor

    Provides a value editor implementation for the Multi URL Picker property editor in Umbraco. Handles the editing and processing of multiple URL values selected by users.

    Inheritance
    object
    DataValueEditor
    Namespace: Umbraco.Cms.Core.PropertyEditors
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public class MultiUrlPickerValueEditor : DataValueEditor, IDataValueEditor, IDataValueReference, ICacheReferencedEntities

    Constructors

    View Source

    MultiUrlPickerValueEditor(ILogger<MultiUrlPickerValueEditor>, ILocalizedTextService, IShortStringHelper, DataEditorAttribute, IPublishedUrlProvider, IJsonSerializer, IIOHelper, IContentService, IMediaService)

    Initializes a new instance of the MultiUrlPickerValueEditor class with the specified dependencies.

    Declaration
    [Obsolete("Please use the constructor taking all parameters. Scheduled for removal in Umbraco 19.")]
    public MultiUrlPickerValueEditor(ILogger<MultiUrlPickerValueEditor> logger, ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute, IPublishedUrlProvider publishedUrlProvider, IJsonSerializer jsonSerializer, IIOHelper ioHelper, IContentService contentService, IMediaService mediaService)
    Parameters
    Type Name Description
    ILogger<MultiUrlPickerValueEditor> logger

    The logger used for logging events and errors.

    ILocalizedTextService localizedTextService

    The service for retrieving localized text.

    IShortStringHelper shortStringHelper

    Helper for handling short string operations.

    DataEditorAttribute attribute

    The data editor attribute that describes the editor.

    IPublishedUrlProvider publishedUrlProvider

    Provider for published URLs.

    IJsonSerializer jsonSerializer

    The serializer used for JSON operations.

    IIOHelper ioHelper

    Helper for IO operations.

    IContentService contentService

    Service for managing content items.

    IMediaService mediaService

    Service for managing media items.

    View Source

    MultiUrlPickerValueEditor(ILogger<MultiUrlPickerValueEditor>, ILocalizedTextService, IShortStringHelper, DataEditorAttribute, IPublishedUrlProvider, IJsonSerializer, IIOHelper, IContentService, IMediaService, AppCaches)

    Initializes a new instance of the MultiUrlPickerValueEditor class.

    Declaration
    public MultiUrlPickerValueEditor(ILogger<MultiUrlPickerValueEditor> logger, ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute, IPublishedUrlProvider publishedUrlProvider, IJsonSerializer jsonSerializer, IIOHelper ioHelper, IContentService contentService, IMediaService mediaService, AppCaches appCaches)
    Parameters
    Type Name Description
    ILogger<MultiUrlPickerValueEditor> logger

    The Microsoft.Extensions.Logging.ILogger<TCategoryName> used for logging.

    ILocalizedTextService localizedTextService

    The ILocalizedTextService for localized text operations.

    IShortStringHelper shortStringHelper

    The IShortStringHelper for string manipulation.

    DataEditorAttribute attribute

    The DataEditorAttribute describing the data editor.

    IPublishedUrlProvider publishedUrlProvider

    The IPublishedUrlProvider for resolving published URLs.

    IJsonSerializer jsonSerializer

    The IJsonSerializer for JSON serialization.

    IIOHelper ioHelper

    The IIOHelper for IO operations.

    IContentService contentService

    The IContentService for content management.

    IMediaService mediaService

    The IMediaService for media management.

    AppCaches appCaches

    The AppCaches instance for caching.

    Methods

    View Source

    CacheReferencedEntities(IEnumerable<object>)

    Caches the entities referenced by the provided block data values.

    Declaration
    public void CacheReferencedEntities(IEnumerable<object> values)
    Parameters
    Type Name Description
    IEnumerable<object> values

    An enumerable collection of block values that may contain the entities to be cached.

    View Source

    FromEditor(ContentPropertyData, object?)

    Converts the value received from the editor (as part of the content property data) into a serialized JSON format suitable for storage.

    Declaration
    public override object? FromEditor(ContentPropertyData editorValue, object? currentValue)
    Parameters
    Type Name Description
    ContentPropertyData editorValue

    The content property data containing the value from the editor, expected to be a JSON array of link objects.

    object currentValue

    The current stored value of the property, if any.

    Returns
    Type Description
    object

    A JSON string representing the collection of links if valid links are found; otherwise, null if the input is empty or invalid.

    View Source

    GetReferences(object?)

    Extracts entity references from the provided value, which is expected to be a JSON-serialized list of links.

    Declaration
    public IEnumerable<UmbracoEntityReference> GetReferences(object? value)
    Parameters
    Type Name Description
    object value

    The value to extract references from. This should be a JSON string representing a collection of links, or null.

    Returns
    Type Description
    IEnumerable<UmbracoEntityReference>

    An enumerable of UmbracoEntityReference objects extracted from the value. If the value is null, empty, or contains no valid references, an empty enumerable is returned.

    View Source

    ToEditor(IProperty, string?, string?)

    Converts the property value of a multi-URL picker to an object suitable for use in the editor UI.

    Declaration
    public override object? ToEditor(IProperty property, string? culture = null, string? segment = null)
    Parameters
    Type Name Description
    IProperty property

    The property whose value will be converted for the editor.

    string culture

    The culture to use for value conversion, or null for the default culture.

    string segment

    The segment to use for value conversion, or null if not applicable.

    Returns
    Type Description
    object

    A collection of LinkDisplay objects representing the editor value, or an empty collection if the property value is null or empty. If deserialization fails, the base implementation's result is returned.

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