Search Results for

    Show / Hide Table of Contents
    View Source

    Class PublishedContentUrlSegmentResolver

    Resolves the URL segment of an IPublishedContent via GetUrlSegment(Guid, string, bool), honouring the ambient variation context and preview state.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Models.PublishedContent
    Assembly: Umbraco.Core.dll
    Syntax
    [Obsolete("Helper for IPublishedContent.UrlSegment during the v18 deprecation period. Use IDocumentUrlService.GetUrlSegment() instead. Scheduled for removal in Umbraco 20.")]
    public static class PublishedContentUrlSegmentResolver
    Remarks

    Helper used to satisfy the obsolete UrlSegment contract during the v18 deprecation period. Scheduled for removal in Umbraco 20 alongside the property itself. New code should call GetUrlSegment(Guid, string, bool) directly.

    Methods

    View Source

    Resolve(IPublishedContent, IVariationContextAccessor?, string?)

    Resolves the URL segment for the specified content, using the supplied culture or falling back to the variation context's current culture, and detecting preview state from the ambient IUmbracoContext.

    Declaration
    public static string? Resolve(IPublishedContent content, IVariationContextAccessor? variationContextAccessor, string? culture = null)
    Parameters
    Type Name Description
    IPublishedContent content

    The content item.

    IVariationContextAccessor variationContextAccessor

    Used to resolve the ambient culture when culture is null.

    string culture

    An explicit culture, or null to use the ambient variation context.

    Returns
    Type Description
    string

    The URL segment, or null if no segment is available for the resolved culture.

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