Class PublishedContentUrlSegmentResolver
Resolves the URL segment of an IPublishedContent via GetUrlSegment(Guid, string, bool), honouring the ambient variation context and preview state.
Inheritance
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 SourceResolve(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 |
| 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. |